private async Task <Photo> AddPhotoToClient(ProviderClient client) { Photo photo = new Photo { ClientId = client.Id }; Db.Photos.Add(photo); await Db.SaveChangesAsync(); return(photo); }
private async Task <ProviderClient> CreateNewClient <T>(T client, Func <T, int> clientId) { var clientHash = await GetClientHash(client, clientId); var newClient = new ProviderClient() { ObjectId = clientId(client), ObjectTypeHash = clientHash }; Db.Clients.Add(newClient); await Db.SaveChangesAsync(); return(newClient); }