예제 #1
0
        public async Task <int> CreateLogAsync(AuditLog auditLog)
        {
            await base._dBContext.OpenDBConnectionAsync();

            using (base._dBContext.DbConnection)
            {
                return(await base._dBContext.DbConnection.ExecuteAsync(
                           DapperHelperQueries.CreateNewLog(auditLog.UserId.ToString(), auditLog.EventTypeId),
                           new { IPv4 = auditLog.IPv4 }
                           ));
            }
        }
예제 #2
0
 public async Task CreateAsync(AppUser user)
 {
     await base._dBContext.ExecuteTransactionAsync(new Dictionary <string, object>()
     {
         {
             @"INSERT INTO AppUser (UserName, Email, Password)
               VALUES (@UserName, @Email, @Password);
             ",
             new { UserName = user.UserName, Email = user.Email, Password = user.Password }
         },
         {
             $@"INSERT INTO AppUserProfile (UserId)
                VALUES ( ( { DapperHelperQueries.SelectSessionLastInsertedUserId() } ) );
             ",
             null
         },
         {
             DapperHelperQueries.CreateNewLog($"( {DapperHelperQueries.SelectSessionLastInsertedUserId()} )", EventTypeId.Register),
             new { IPv4 = user.Ipv4 }
         }
     }, false);
 }