コード例 #1
0
        private async Task <Photo> AddPhotoToClient(ProviderClient client)
        {
            Photo photo = new Photo {
                ClientId = client.Id
            };

            Db.Photos.Add(photo);
            await Db.SaveChangesAsync();

            return(photo);
        }
コード例 #2
0
        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);
        }