private bool AddContact(Guid userId, Guid unknownContactId) { Log.Information($"Adding {unknownContactId} to {userId}'s contacts"); var contact = new UserContact { UserId = userId, ContactId = unknownContactId, CreatedOn = DateTime.UtcNow }; _dbContext.Contacts.Add(contact); return(_dbContext.SaveChanges() == 1); }
private bool AddUser(User user) { Log.Information($"Add User with username: {user.Username}"); _dbContext.Users.Add(user); return(_dbContext.SaveChanges() == 1); }