BlogEngine.Core.Providers.DbBlogProvider.DeleteProfile C# (CSharp) Method

DeleteProfile() public method

Remove AuthorProfile from database
public DeleteProfile ( AuthorProfile profile ) : void
profile AuthorProfile An AuthorProfile.
return void
        public override void DeleteProfile(AuthorProfile profile)
        {
            using (var conn = this.CreateConnection())
            {
                if (conn.HasConnection)
                {
                    using (var cmd = conn.CreateTextCommand(string.Format("DELETE FROM {0}Profiles WHERE BlogID = {1}blogid AND UserName = {1}name", this.tablePrefix, this.parmPrefix)))
                    {
                        cmd.Parameters.Add(conn.CreateParameter(FormatParamName("blogid"), Blog.CurrentInstance.Id.ToString()));
                        cmd.Parameters.Add(conn.CreateParameter(FormatParamName("name"), profile.Id));
                        cmd.ExecuteNonQuery();
                    }
                }
            }
        }