Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

dataminers

@dataminers
About
Posts
233
Topics
108
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What does the Rollback method in EF Core do?
    D dataminers

    Thank you for the explanation. Actually, I guessed but wasn't sure. Many thanks @RichardDeeming @Richard-MacCutchan

    .NET (Core and Framework) asp-net database help tutorial question

  • What does the Rollback method in EF Core do?
    D dataminers

    Thanks for the answer @Richard-MacCutchan I read the article, but I didn't get the exact answer to my question. The EF Core working structure is different. Each process is primarily tracked on the memory. Makes my question a little clearer. What is the difference in effect between the two codes below? FIRST CODE:

    using (var context = new AppDbContext())
    {
    using (var transaction = context.Database.BeginTransaction())
    {
    try
    {
    var myObjectOne = new MyObjectOne() { Name = "Book" };
    context.MyObjectOnes.Add(myObjectOne);
    context.SaveChanges();

            var myVal = myObjectOne.Id \* 3.14;
    
            //Suppose an error occurs here
    
            var myObjectTwo = new MyObjectTwo() { Name = "Notebook", Price = 100, ReferenceId = myVal };
            context.MyObjectTwos.Add(myObjectTwo);
            context.SaveChanges();
    
            transaction.Commit();
        }
        catch (Exception ex)
        {
            transaction.Rollback();
        }
    }
    

    }

    SECOND CODE:

    using (var context = new AppDbContext())
    {
    using (var transaction = context.Database.BeginTransaction())
    {
    try
    {
    var myObjectOne = new MyObjectOne() { Name = "Book" };
    context.MyObjectOnes.Add(myObjectOne);
    context.SaveChanges();

            var myVal = myObjectOne.Id \* 3.14;
    
            //Suppose an error occurs here
    
            var myObjectTwo = new MyObjectTwo() { Name = "Notebook", Price = 100, ReferenceId = myVal };
            context.MyObjectTwos.Add(myObjectTwo);
            context.SaveChanges();
    
            transaction.Commit();
        }
        catch (Exception ex)
        {
            //Nothing
        }
    }
    

    }

    .NET (Core and Framework) asp-net database help tutorial question

  • What does the Rollback method in EF Core do?
    D dataminers

    Hi, RollBack method; Roll back whatever changes have been made to the database. Following example I didn't use Commit(), what will RollBack() do? What exactly did transaction.Rollback() do?

    using (var context = new AppDbContext())
    {
    using (var transaction = context.Database.BeginTransaction())
    {
    try
    {
    var myObjectOne = new MyObjectOne() { Name = "Book" };
    context.MyObjectOnes.Add(myObjectOne);
    context.SaveChanges();

            var myVal = myObjectOne.Id \* 3.14;
    
            //Suppose an error occurs here
    
            var myObjectTwo = new MyObjectTwo() { Name = "Notebook", Price = 100, ReferenceId = myVal };
            context.MyObjectTwos.Add(myObjectTwo);
            context.SaveChanges();
    
            transaction.Commit();
        }
        catch (Exception ex)
        {
            transaction.Rollback();
        }
    }
    

    }

    thanks... :confused:

    .NET (Core and Framework) asp-net database help tutorial question

  • Async - await
    D dataminers

    Thank you very much for your interest and concern @RichardDeeming

    C# question

  • Async - await
    D dataminers

    I got my answer, thanks. I have one more question. You said "it blocks the rest of the method" yes the following codes will not be executed until the job is complete, what exactly is waiting here? I guess it was a deep question :^)

    C# question

  • Async - await
    D dataminers

    Hi, Why Sample #2 is "Bets Practices". Second sample include "await" keyword on the same line with Async Method. Both codes are blocking Thread. Any idea? thanks... Sample #1

    var products = _context.Products.ToList();

    Sample #2

    var products = await _context.Products.ToListAsync();

    C# question

  • PLINQ - WithDegreeOfParallelism
    D dataminers

    Sometimes people get confused when you read a lot. You know, not all information on the Internet is correct. That's why I'm investigating the issue. Please don't get me wrong. Multi-Thread: Running more than one Threads inside a Process. Parallel Programming: Running threads simultaneously on different cores in multi-core processors. So; .NET Core TPL (Task Parallel Library) is Multi-Thread programming, not a Parallel Programming. Isn't it?

    .NET (Core and Framework) database question

  • PLINQ - WithDegreeOfParallelism
    D dataminers

    Dear Richard, thank you for your reply. I understand that based on your answer, the two code blocks below are the same;

    await Task.Run(() =>
    {
    CalculateSomething(5);
    });

    await Task.Run(() =>
    {
    CalculateSomething(8);
    });

    List myList = new() { 5, 8 };

    myList.AsParallel().WithDegreeOfParallelism(2).ForAll(x =>
    {
    CalculateSomething(x);
    });

    Both complete the process on two Threads. Note: CalculateSomething hypothetically this function takes a very long time Regards...

    .NET (Core and Framework) database question

  • PLINQ - WithDegreeOfParallelism
    D dataminers

    WithDegreeOfParallelism: Degree of parallelism is the maximum number of concurrently executing tasks that will be used to process the query. I don't quite understand what you mean by this sentence. --> "concurrently executing tasks" What exactly is meant by "TASK"? CPU or Kernel or something else??? What does "3" do in the code block below; AdventureWorks2017Context context = new AdventureWorks2017Context(); context.Products.AsParallel().WithDegreeOfParallelism(3).ForAll(p => { //ToDO }) Best Regards...

    .NET (Core and Framework) database question

  • MultiThread on Single Core Processor (CPU)
    D dataminers

    many thanks...

    .NET (Core and Framework) asp-net question

  • MultiThread on Single Core Processor (CPU)
    D dataminers

    Is it possible to run multi-threads on a single-core processor? Best Regards...

    .NET (Core and Framework) asp-net question

  • Catch JavaScript errors
    D dataminers

    Is it enough methods for capture and report JavaScript errors on web page on computer and mobile devices?

    window.onerror = function (msg, url, lineNo, columnNo, error) {
    //post data for log
    return true;
    };

    C# javascript help question

  • Capture and report JavaScript errors
    D dataminers

    Is it enough for methods to be capture and report JavaScript errors on web applications on computer and mobile devices?

    window.onerror = function (msg, url, lineNo, columnNo, error) {
    //post data for log
    return true;
    };

    ASP.NET javascript help question

  • vector based 2D line drawing
    D dataminers

    Thanks for reply, bu i dont want to render image, i just; want to draw line from x-y point to x-y point GDI+ Sample; Pen myPen = new Pen(Color.Blue, 2); Point myStartPoint = new Point(10, 10); Point myEndPoint = new Point(15, 5); myGraphics.DrawLine(myPen, myStartPoint, myEndPoint); But its created pixel by pixel. Real example; If I use MS Paint and i draw cross line, line will be shown pixel by pixel If I use Inkscape (its vector graphics software) and i draw cross line, line will be shown smooth. thanks...

    C# graphics question csharp

  • vector based 2D line drawing
    D dataminers

    Actually I want to draw cross line use with X - Y coordinates and save as PDF format. For example; FROM New Point(x: 10, y: 10) TO New Point(x: 15, y: 5) AND DRAW LINE. If I use GDI+ library, this line shown pixel. I want to smooth line. MS Paint Pixel based drawing program, If I draw cross line on MS Paint, will be shown pixel. If I use Inkscape (its vector graphics software) and draw cross line after save as PDF file so line will be smooth.

    C# graphics question csharp

  • vector based 2D line drawing
    D dataminers

    Actually I want to draw cross line use with X - Y coordinates and save as PDF format. For example FROM New Point(x: 10, y: 10) TO New Point(x: 15, y: 5) AND DRAW LINE. If I use GDI+ library, this line shown pixel. I want to smooth line. MS Paint Pixel based drawing program, If I draw cross line on MS Paint, will be shown pixel. If I use Inkscape (its vector graphics software) and draw cross line after save as PDF file so line will be smooth.

    C# graphics question csharp

  • vector based 2D line drawing
    D dataminers

    Hi, How can i vector based 2D line drawing in C#. I want to get smooth line when i get printout, so i don't want to pixel based drawing. Whats is the easiest way? many thanks...

    C# graphics question csharp

  • How can I detect a VPN connection
    D dataminers

    There is any way for detecting client request is from Virtual Private Network or directly client computer?

    .NET (Core and Framework) question

  • How can I detect a VPN connection
    D dataminers

    How can I detect a VPN connection? How can I detecting application request from VPN, Is it possible?

    .NET (Core and Framework) question

  • MVC Config File / MAPPING
    D dataminers

    This night I try the asp.net mvc framework which is ASP.NET MVC 2 Empty Web Application. I create controller class, model class and view page. Its successfully run. But I can't find configuration file for classes and page mapping. Actually I want to mapping classes and views by custom on xml based file like spring bean xml configuration on Java environment. thanks your advice...

    C# java asp-net workspace csharp xml
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups