entity framework

  1. fokwabest

    How to execute stored procedure in ASP.NET Core 3.1 and assign result sets to variables

    I am new to ASP.NET Core (3.1). I have a stored procedure that takes two parameters: startDate and endDate. It returns the following result sets in one go (or execution): I want to be able to grab the result sets in 3 separate variables because I will like to...
  2. ahmedaziz

    How to call stored procedure procedure using entity framework core?

    I work on asp.net core entity framework I have csharp function done using ado dotnet stored proceure i need to convert it using entity framwork core with another meaning how to call stored proceure using entity framework core 6 and i don't need to use ado dotnet stored procedure so How to...
  3. R

    How to check if the record exists with the same value in the database before insert

    Hello there, In my Blazor Server application, I am inserting a list of data into a database as follows with EF Core 6; public async Task AddStockAsync(List<GameBank> gameBank) { await _oyunPalasContext.GameBanks.AddRangeAsync(gameBank); await _oyunPalasContext.SaveChangesAsync(); } I...
  4. R

    Weird behavior SaveChangesAsync

    Hello guys, I have this Blazor Server application. I am adding (OnSubmit) records by selecting the game, quantity, and description. The problem is when I add records one after another by clicking the purchase button, the previously added record gets the value of the last added record as you can...
  5. R

    Question How would you compare an excel with data in the database table?

    Hello friends, I am working on a Blazor Server application. I would like to upload an excel file, consisting of a couple of columns. (ReferenceId-guid, Order Date-datetime, Product Code-string, and Product Description-string) This excel file roughly has 200000 rows of data. I am gonna use...
  6. R

    EF Core 6 - Primary key incrementing problem

    Hello friends, I am working on a Blazor Server application which is running on production for a while. There is an Orders table, user can insert records. Here is the table structure; USE [InventoryManagement] GO /****** Object: Table [dbo].[Orders] Script Date...
  7. A

    Question What telement mean here and when it use it?

    I work on .net core 6 vs 2022 i see function have telement but i don't know what this mean can you show me please ? and when use it are there are any thing best from using telement or more general What I have tried: public List<TElement> SQLQuery<TElement>(string sql, string...
  8. A

    when make login using simple membership it not logged in success although I use same user name and password?

    I work on Web API c# web app . I face issue I can't login success although I have same username and password . when make break point on websecurity.login then trace it jump to ModelState.AddModelError so are there are any settings remaining or some configuration not done . public JsonResult...
  9. uzeren

    C# timer

    Hello, I'm doing a windows form project, in this project, when I subtract the entry date from the end date, I reflect the result to a column named remaining usage. What I want in the database is that this remaining usage decreases by 1 every 24 hours
  10. S

    Resolved Digital Menu Display System Database Design (EntityFramework Core)

    I would like to develop a digital display menu system which doesn't include any ordering feature. Currently I get stuck in handling entity relationship between menu list and menu item. Should I use a mapping table for them? or I can simply handle menu items inside menu list instead of creating...
  11. S

    Hi can anyone tell me why I'm getting a empty list back when executing this entity framework query?

    See code below: public ActionResult<List<string>> FetchConfig([FromBody] FetchConfigDto fetchConfigDto) { List<string> myResult = new List<string>(); _logger.Debug("getting config from database"); try {...
  12. D

    Scaffolding after install the program

    Hi everyone, Is it possible to do scaffolding after install our program and run it? Is using powershell right way to go to do this? Or what else can I do? I need any advice of you. Thank you.
  13. D

    Run Scaffolding Command in C# Code with Powershell Runspace

    Hi, I need to do scaffolding in code. To do this I wrote this method; public string RunScript(string scriptText) { string dir = @"C:\Users\demetsen\source\repos\ScaffoldingInCode\ScaffoldingInCode"; Directory.SetCurrentDirectory(dir); Runspace...
  14. R

    Adding a new property to an existing model

    Hi, I wonder if it is a good practice to add this line of code to production? error: System.InvalidOperationException HResult=0x80131509 Message=The model backing the 'GameContext' context has changed since the database was created. Consider using Code First Migrations to update the...
  15. Gcobani54

    Joining three entities using linq

    Hi Team I need some help in joining three entities using linq, i have one join but the problem i have i am getting a repetion of years, weekNum and day colums with data being incorrect. public IList<ExtractionViewModel> GetExtractionViewModels(string year, int week) {...
  16. M

    Question Same query fired multiple times EF

    I'm building a very simple CRUD web-application (ASP.NET MVC) for tennisplayers and the tournaments they can participate. On a specific page I want to show all tournaments in the database with a title at the top op the page 'All Tournaments' with between brackets the amount of records in the...
  17. etkmlm

    Question Validation Messages Not Working

    Hi, I have an issue with validation messages. I think the problem is caused by 2 post method. [HttpGet] [Authorize] public ActionResult Others(string bid) { return View(ret); } [HttpPost] public ActionResult...
  18. M

    EF returning old data

    Hi everyone, I'm making a very simple CRUD console application using EF and sqlite. I have 3 domain model classes, being: Player, Tournament and TournamentEnrollment public class Player { [Key] public int Id { get; set; } [Required] public string...
  19. M

    Beginners question regarding AsEnumerable()

    I'm following a EF Core (beginners) course and there is something I don't understand. Below you can find the most important classes of a little excercise we got, to get to know EF core and the intent. public class Student { public int StudentId { get; set; } public string...
  20. etkmlm

    Resolved Entity Framwork Not Working

    i have a problem with Entity. Want to use Entity in DbContext class but it is not working even though I added it to the packages. So when i write the "System.Data.Entity", it turns red. (Error: CS0234) Maybe Visual Studio doesn't see the Entity package. Visual Studio 2019 .NET Core 2.0...
Back
Top Bottom