Exemplo n.º 1
0
 static async Task <IEnumerable <Donator> > GetDonatorsAsync()
 {
     using (var db = new Context.Contextc())
     {
         return(await db.Donator.ToListAsync());
     }
 }
Exemplo n.º 2
0
 public static void Example4()
 {
     using (var db2 = new Context.Contextc())
     {
         var sql = @" SelectDonatorsPro {0} ";
         var donatorsViaCommand = db2.Database.SqlQuery <DonatorFromStoreProcedure>(sql, "河北省");
         foreach (var donator in donatorsViaCommand)
         {
             Console.WriteLine(donator.ProvinceName + "\t" + donator.Amount + "\t" + donator.DonateDate);
         }
     }
 }