Beispiel #1
0
 private Client(ClientEntity entity)
 {
     Id = entity.Id;
     ContactEmailAddress = entity.ContactEmailAddress;
     BillingEmailAddress = entity.BillingEmailAddress;
     Name = entity.Name;
     PhoneNumber = entity.PhoneNumber;
 }
Beispiel #2
0
        public async Task<ClientEntity> Add(string name, string billingEmail, string contactEmail, string phone)
        {
            ClientEntity newEntity = new ClientEntity
            {
                BillingEmailAddress = billingEmail,
                ContactEmailAddress = contactEmail,
                Name = name,
                PhoneNumber = phone
            };

            var result = model.ClientEntities.Add(newEntity);
            await model.SaveChangesAsync();

            return result;
        }