コード例 #1
0
        public void UnitTest_CRUD_Read()
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();

            var tarkOrm     = new TarkOrm("localhost");
            var countryList = tarkOrm.GetAll <Country>();
            var country     = tarkOrm.GetById <Country>(30);

            var countryPartial = tarkOrm.GetById <CountryPartial>(30);

            watch.Stop();

            Debugger.Log(0, "", $"TarkORM Elapsed MS: {watch.ElapsedMilliseconds.ToString()}{Environment.NewLine}");
        }
コード例 #2
0
        public void UnitTest_ManualMapping()
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();

            var tarkOrm = new TarkOrm("localhost");

            TarkConfigurationMapping.AutoMapType <TestOrmTestMapping>()
            .MapProperty(x => x.classx, "Classification")
            .MapProperty(x => x.description, "Name")
            .ToTable("TestOrm");

            var list = tarkOrm.GetAll <TestOrmTestMapping>();

            watch.Stop();

            Debugger.Log(0, "", $"TarkORM Elapsed MS: {watch.ElapsedMilliseconds.ToString()}{Environment.NewLine}");
        }
コード例 #3
0
        public void BenchmarkCountryTark()
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();

            //Tark
            var data = new TarkOrm("data source=PH03N1XR4V4N-PC\\DBLABS;initial catalog=MyPortal;persist security info=True;user id=app_login;password=ph03n1xr4v3n;MultipleActiveResultSets=True;App=TarkOrm");

            var lista = data.GetAll <Country>();

            foreach (var item in lista)
            {
                item.Name.ToString();
            }

            watch.Stop();

            Debugger.Log(0, "", $"TarkORM Elapsed MS: {watch.ElapsedMilliseconds.ToString()}{Environment.NewLine}");
        }