var result = Context.User.Where(p => p.ID == UserID && p.Withdrawal == null).Select(c=>c.Deposit).ToList().ConvertAll<decimal>(x=>Convert.ToDecimal(x)).Sum(c => c);
this blog to share the problems, technical challenges and their solutions what I faced in my day to day development activity. https://www.gopaisa.com/ref/M6UVCW
Friday, December 28, 2012
Using ConvertAll in Generic List
var result = Context.User.Where(p => p.ID == UserID && p.Withdrawal == null).Select(c=>c.Deposit).ToList().ConvertAll<decimal>(x=>Convert.ToDecimal(x)).Sum(c => c);
Saturday, December 15, 2012
Adding Integers to List
List<int> li = new List<int>();
li.Add(1);
li.Add(0);
li.Add(1);
li.Add(200);
li.Add(20);
li.Add(3);
li.Add(100);
li.Add(12);
if (li.Contains(0))
{
}
if (li.Contains(10))
{
}
if (li.Contains(2))
{
}
EntityFunction for adding days
EntityFunctions.AddDays(DateTime? DateValue, int? intValue)) in Entity FrameWork
Saturday, December 1, 2012
Entity framework include for child table
var widgetDTO = DBContext.test_widget .Include("test_Parent.test_Child").Where(p => p.ID == wID).ToList();
In the above code ".Include("test_Parent.test_Child")" ---
test_Child is the child table and
test_Parent Parent table.
Subscribe to:
Posts (Atom)