public int Create(LoginCreate request)
        {
            using (var con = GetConnection())
            {
                var cmd = con.CreateCommand();
                cmd.CommandText = "User_Create";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@email", request.Email);
                cmd.Parameters.AddWithValue("@passwordHash", request.PasswordHash);
                cmd.Parameters.AddWithValue("@isAdmin", request.IsAdmin);
                cmd.Parameters.Add("@Id", SqlDbType.Int).Direction = ParameterDirection.Output;

                cmd.ExecuteNonQuery();
                return((int)cmd.Parameters["@Id"].Value);
            }
        }
Ejemplo n.º 2
0
 public int Create(LoginCreate model)
 {
     return(loginService.Create(model));
 }