public static Task <IEnumerable <PersonalInfo> > GetAllPersonalInfo()
 {
     try
     {
         var result = new RepositoryPersonalInfo().GetAll();
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public async static Task <string> InsertIntoMSSQLDB(PersonalInfo entity)
        {
            try
            {
                //Test: Get all data
                IEnumerable <PersonalInfo> list = await GetAllPersonalInfo();

                var result = new RepositoryPersonalInfo().Insert(entity);
                return(result.Result.ToString());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Started....");
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Reset();
            stopWatch.Stop();


            stopWatch.Reset();

            stopWatch.Start();
            var result = new RepositoryPersonalInfo().GetAll();

            stopWatch.Stop();
            Console.WriteLine("Total execution time by manual mapping: " + stopWatch.Elapsed.TotalSeconds);



            stopWatch.Reset();

            stopWatch.Start();
            var result2 = new RepositoryPersonalInfo().GetAllDynamic();

            stopWatch.Stop();
            Console.WriteLine("Total execution time by dynamic mapping: " + stopWatch.Elapsed.TotalSeconds);


            stopWatch.Reset();

            stopWatch.Start();
            var result3 = new RepositoryPersonalInfo().GetAllDynamic2();

            stopWatch.Stop();
            Console.WriteLine("Total execution time by dynamic 2 mapping: " + stopWatch.Elapsed.TotalSeconds);



            Console.ReadKey();
        }