示例#1
0
        public static AvtoViewModel AvtoViewReturn(int id, BDModel.AvtoModel context)
        {
            var temp = context.avtoes.
                       Include(e => e.repairs).ThenInclude(e => e.work_data).ThenInclude(e => e.worker).
                       Include(e => e.repairs).ThenInclude(e => e.work_data).ThenInclude(e => e.profession).
                       Include(e => e.repairs).ThenInclude(e => e.type_of_repair).
                       Include(e => e.department).
                       Include(e => e.avto_worker).ThenInclude(e => e.work_data).ThenInclude(e => e.worker).
                       Include(e => e.avto_worker).ThenInclude(e => e.work_data).ThenInclude(e => e.profession).
                       Include(e => e.avto_worker).ThenInclude(e => e.divisions).ThenInclude(e => e.way).
                       Include(e => e.brand).ThenInclude(e => e.manufacturer).
                       Include(e => e.brand).ThenInclude(e => e.type_of_avto).
                       Where(e => e.Avto_Key == id).FirstOrDefault();

            AvtoViewModel avtoViewModel = new AvtoViewModel()
            {
                Avto_Key          = temp.Avto_Key,
                additional_info   = temp.additional_info,
                avto_worker       = temp.avto_worker,
                cancelletion_date = temp.cancelletion_date,
                color             = temp.color,
                department        = temp.department,
                Department_Key    = temp.Department_Key,
                image_byte        = temp.image_byte,
                brand             = temp.brand,
                Brand_Key         = temp.Brand_Key,
                namber            = temp.namber,
                receipt_date      = temp.receipt_date,
                repairs           = temp.repairs,
                sell_cost         = temp.sell_cost,
                when_cancellation = temp.when_cancellation,
                when_sell         = temp.when_sell,
                year_of_release   = temp.year_of_release,
                typemass          = context.type_of_avto.ToList(),
                departmass        = context.departments.ToList(),
                brandlist         = context.brands.Include(e => e.manufacturer).ToList(),
            };

            return(avtoViewModel);
        }
示例#2
0
 public AddSomeController(BDModel.AvtoModel context)
 {
     _context = context;
 }
示例#3
0
 public CancellationController(BDModel.AvtoModel context)
 {
     _context = context;
 }
示例#4
0
 public ShowsController(BDModel.AvtoModel context)
 {
     _context = context;
 }
示例#5
0
 public EditController(BDModel.AvtoModel context)
 {
     _context = context;
 }