public async Task <IActionResult> Add() { var user = await _context.User.FirstOrDefaultAsync(u => u.Login == User.Identity.Name); var model = new SmartContractModel(); model.hash_сustomer = user.Hash; return(View(model)); }
public static SmartContractEntity ToSmartContractEntity(this SmartContractModel smartContractModel) => new SmartContractEntity() { Id = smartContractModel.Id, CompanyEntity = smartContractModel.CompanyModel?.ToCompanyEntity(), ConclusionCondition = smartContractModel.ConclusionCondition, Description = smartContractModel.Description, TerminationCondition = smartContractModel.TerminationCondition, Title = smartContractModel.Title, Value = smartContractModel.Value };
public static SmartContractViews ToSmartContractView(this SmartContractModel smartContractModel) { return(new SmartContractViews() { Id = smartContractModel.Id, Title = smartContractModel.Title, Description = smartContractModel.Description, TerminationCondition = smartContractModel.TerminationCondition, ConclusionCondition = smartContractModel.ConclusionCondition, Value = smartContractModel.Value, CompanyModel = smartContractModel.CompanyModel }); }