Ejemplo n.º 1
0
        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}");
            }
        }
Ejemplo n.º 2
0
 private async Task <Person> GetBy(IPersonContainer personContainer)
 {
     return(await this.PersonDataAccess.GetByAsync(personContainer));
 }
Ejemplo n.º 3
0
 public Person GetOwnerOfPlace(IPersonContainer container)
 {
     return(PersonDataAccess.GetOwnerOfPlace(container));
 }
Ejemplo n.º 4
0
 public Task <Person> GetByAsync(IPersonContainer personId)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
        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));
        }