public async Task <DirectionDto> GetDirectionByIdAsync(Guid id)
        {
            DirectionDto direction = DirectionConverter.Convert(await _directionRepo.GetByIdAsync(id));

            direction.Administration = AdministrationConverter.Convert(await _adminRepo.GetByDirectionIdAsync(id));
            direction.Courses        = CourseConverter.Convert(await _courseRepo.GetByDirectionIdAsync(id));
            return(direction);
        }
        public async Task <List <DirectionDto> > GetAllDirectionAsync()
        {
            List <DirectionDto> directions = DirectionConverter.Convert(await _directionRepo.GetAllAsync());
            List <CourseDto>    courses    = await GetAllCourseAsync();

            foreach (DirectionDto i in directions)
            {
                i.Courses = courses.Where(x => x.DirectionId == i.Id).ToList();
            }
            return(directions);
        }
Пример #3
0
 public override bool MoveOnThis(Truck truck, Direction direction)
 {
     if (_Movable == null)
     {
         _Movable = truck;
         _PlacedCounter++;
         return(true);
     }
     else
     {
         if (DirectionConverter.Convert(this, direction).MoveOnThis(_Movable, direction))
         {
             _Movable     = truck;
             truck._Field = this;
             _PlacedCounter++;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Пример #4
0
 public override string ToString()
 {
     return(string.Format("{0} {1} {2} 量:{4} 价:{3}", this.InstrumentID, offsetFlagConverter.Convert(this.OffsetFlag), directionConverter.Convert(this.Direction), this.Volume, this.Price));
 }
 public async Task <bool> UpdateDirectionAsync(DirectionDto item)
 {
     return(await _directionRepo.UpdateAsync(DirectionConverter.Convert(item)));
 }
 public async Task <DirectionDto> CreateDirectionAsync(DirectionDto item)
 {
     return(DirectionConverter.Convert(await _directionRepo.CreateAsync(DirectionConverter.Convert(item))));
 }