Example #1
0
        public static int DeleteByTypeAndValue(SoftFluent.Samples.AspNetIdentity1.User user, string type, string value)
        {
            if ((user == null))
            {
                throw new System.ArgumentNullException("user");
            }
            if ((user.Id == default(string)))
            {
                CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "user", "SoftFluent.Samples.AspNetIdentity1.User");
            }
            if ((type == default(string)))
            {
                throw new System.ArgumentNullException("type");
            }
            if ((value == default(string)))
            {
                throw new System.ArgumentNullException("value");
            }
            CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity1.Constants.SoftFluent_Samples_AspNetIdentity1StoreName).Persistence;
            persistence.CreateStoredProcedureCommand(null, "UserClaim", "DeleteByTypeAndValue");
            persistence.AddParameter("@UserId", user.Id, default(string));
            persistence.AddParameter("@Type", type, default(string));
            persistence.AddParameter("@Value", value, default(string));
            int count;

            count = persistence.ExecuteScalar(-1);
            return(count);
        }
        public static int DeleteByTypeAndValue(string type, string value)
        {
            if ((type == default(string)))
            {
                throw new System.ArgumentNullException("type");
            }
            if ((value == default(string)))
            {
                throw new System.ArgumentNullException("value");
            }
            CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.Thinktecture.IdentityServer.Constants.SoftFluent_Samples_Thinktecture_IdentityServerStoreName).Persistence;
            persistence.CreateStoredProcedureCommand(null, "UserClaim", "DeleteByTypeAndValue");
            persistence.AddParameter("@Type", type, default(string));
            persistence.AddParameter("@Value", value, default(string));
            int count;

            count = persistence.ExecuteScalar(-1);
            return(count);
        }
Example #3
0
        public static int DeleteByUserAndProviderKey(SoftFluent.Samples.Thinktecture.IdentityServer.User user, string providerKey)
        {
            if ((user == null))
            {
                throw new System.ArgumentNullException("user");
            }
            if ((user.Id.Equals(CodeFluentPersistence.DefaultGuidValue) == true))
            {
                CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "user", "SoftFluent.Samples.Thinktecture.IdentityServer.User");
            }
            if ((providerKey == default(string)))
            {
                throw new System.ArgumentNullException("providerKey");
            }
            CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.Thinktecture.IdentityServer.Constants.SoftFluent_Samples_Thinktecture_IdentityServerStoreName).Persistence;
            persistence.CreateStoredProcedureCommand(null, "Login", "DeleteByUserAndProviderKey");
            persistence.AddParameter("@UserId", user.Id, CodeFluentPersistence.DefaultGuidValue);
            persistence.AddParameter("@ProviderKey", providerKey, default(string));
            int count;

            count = persistence.ExecuteScalar(-1);
            return(count);
        }