_quatationRepository = new QuatationRepository();
IList<Quatation> quatationObj = _quatationRepository.GetAll(quatation => quatation.IsDeleted == 0);
IList<QuatationModel> quatationModelObj = new List<QuatationModel>();
AutoMapper.Mapper.CreateMap<Quatation, QuatationModel>();
quatationModelObj = AutoMapper.Mapper.Map(quatationObj, quatationModelObj);
return quatationModelObj;
public partial class Quatation
{
public int QuatationId { get; set; }
public int FirmId { get; set; }
public int ItemId { get; set; }
public double Quantity { get; set; }
public decimal Price { get; set; }
public Nullable Dated { get; set; }
public Nullable IsDeleted { get; set; }
public Nullable CreatedDate { get; set; }
public Nullable CreatedBy { get; set; }
public Nullable ModifyDate { get; set; }
public Nullable ModifyBy { get; set; }
public virtual Firm Firm { get; set; }
public virtual Item Item { get; set; }
}
public class QuatationModel
{
public int QuatationId { get; set; }
public int? FirmId { get; set; }
public int ItemId { get; set; }
public double Quantity { get; set; }
public decimal Price { get; set; }
public DateTime? Dated { get; set; }
public int IsDeleted { get; set; }
public DateTime? CreatedDate { get; set; }
public int? CreatedBy { get; set; }
public DateTime? ModifyDate { get; set; }
public int? ModifyBy { get; set; }
//public string ItemName { get; set; }
//public List<SelectListItem> LstFirm { get; set; }
public virtual FirmModel Firm { get; set; }
public virtual ItemModel Item { get; set; }
//public IList<QuatationModel> LstQuatation { get; set; }
}
我們可以看到您的Quatation和QuatationModel類屬性嗎? – Seany84
您能否請檢查並儘快給我答覆..其緊急感謝 –
我已更新我的答案。你可以試試看,讓我知道它是否工作? – Seany84