public async Task ValidateAsync(IPersonContainer personContainer) { if (personContainer == null) { throw new ArgumentNullException(nameof(personContainer)); } var person = await this.GetBy(personContainer); if (personContainer.PersonId.HasValue && person == null) { throw new InvalidOperationException($"Person not found by id {personContainer.PersonId}"); } }
private async Task <Person> GetBy(IPersonContainer personContainer) { return(await this.PersonDataAccess.GetByAsync(personContainer)); }
public Person GetOwnerOfPlace(IPersonContainer container) { return(PersonDataAccess.GetOwnerOfPlace(container)); }
public Task <Person> GetByAsync(IPersonContainer personId) { throw new NotImplementedException(); }
public Parking.Person GetOwnerOfPlace(IPersonContainer placeId) { var result = this.ApplicationContext.Person.Where(p => p.Id == placeId.PersonId).First(); return(this.Mapper.Map <Parking.Person>(result)); }