संभव डुप्लिकेट:
The entity cannot be constructed in a LINQ to Entities queryसंस्था या जटिल प्रकार '' संस्थाओं के लिए एक LINQ का निर्माण नहीं किया जा सकता क्वेरी
var tasks = from i in data.Incidents
join a in data.Accounts on i.CustomerID equals a.Acct_CID
select new Tasks()
{
creator_id = a.ID,
start_date = i.DateOpened,
end_date = i.DateCLosed,
product_code = i.ProductCode,
install_type = i.InstallType,
os = i.OSType,
details = i.Description,
solution = i.Solution,
creator_name = i.TechID,
category = i.Title,
text = "Ticket for" + " " + i.Name,
status_id = 7
};
foreach (var task in tasks)
data.Tasks.Add(task);
data.SaveChanges();
public class Incidents
{
[Key]
public int IncidentID { get; set; }
public string CustomerID { get; set; }
public string ProductCode { get; set; }
public string TechID { get; set; }
public DateTime DateOpened { get; set; }
public DateTime DateCLosed { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Solution { get; set; }
public string Name { get; set; }
public string OSType{ get; set; }
public string InstallType { get; set; }
public string AddOnSoftware { get; set; }
public string ScreenShare { get; set; }
}
मुझे एक त्रुटि देता है जब मैं पुनरावृति करने की कोशिश, मुझे इस
तरह से यह एक डुप्लीकेट के रूप में उन प्रश्नों इसके बारे में लगता है कि आप एक इकाई पर परियोजना के लिए नहीं एक नियमित/गुमनाम प्रकार कोशिश कर रहे हैं से मेरा – Chazt3n
का जवाब नहीं दिया नहीं है कर सकते हैं वह एक जैसे है। दिमाग में यह कहता है * संभव * डुप्लिकेट। – James
10-4 धन्यवाद। – Chazt3n