zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

17 results in tag: razor-pages

Adding a property to a Model in the ViewModel

With the Model...public class Person { public string Forename { get; set; } public string Surname { get; set; } public string DOB { get; set; } } ...I have a ViewModel which I'll be passing through to the View...public class PersonViewMo...
asp.net-core-mvc entity-framework-core razor-pages
asked by Dave

ef core one to many relationship throw exception Cannot add or update a child row

My Shop and Product entities have a one to many relationship, please see my models...public class Product { public int ID { get; set; } public string Name { get; set; } public string Tag { get; set; } public string Brand { get; set; } publi...
asp.net-core c# entity-framework-core mysql razor-pages
asked by Allen4Tech

Getting System.ObjectDisposedException when redirecting pages

Update: The problem was that the OnGet methods was async. Thank you everyone for the help and input!...In my first page (Home) i'm getting a list of Users: ...HomePageModel:...public async void OnGetAsync() { var everything = await _contex...
asp.net-core c# entity-framework-core razor-pages
asked by aneko5

How Do I make a Razor Form for a complex EF Model

I am beginning to wonder if what I am about to ask is even possible.. But it SHOULD be. ...The MS examples are woefully short of what I am after so maybe EF isn't designed the way I thought. (BTW Scaffold for CRUD for each individual table works great. Bu...
asp.net-core-2.1 c# entity-framework entity-framework-6 razor-pages
asked by CBERBER

How do I model a 3-table database in a ASP.NET web app using Razor Pages?

Creating my first web app. Using ...ASP.NET... and ...Razor Pages...+.... Developing it in VS 2017....(Note: Similar to unanswered S.O. question ...ASP.NET Core : Generate Razor Pages for all models...)...+In ASP.NET Core tutorials [...https://docs.micros...
asp.net entity-framework-core multiple-tables razor-pages sql-server
asked by William Charlton

IFormFile 'System.InvalidOperationException'

The non-public.member _baseStream attribute in IFormFile in my ASP.NET Core application throws the following exception after uploading a file:...ReadTimeout = ((Microsoft.AspNetCore.Http.Internal.FormFile)BildUpload)._baseStream.ReadTimeout' threw an ex...
asp.net-core entity-framework-core iformfile razor-pages
asked by pschlz

Select tag helper selected value not rendered in view

I need some help with my select tag helper. ...I have an asp.net MVC View with a select 2 control as follows:...<div class="col-md-3"> <div class="form-group"> <label asp-for="NumberingType.Type" class="control-label" data-toggle="popover" d...
asp.net-core-tag-helpers asp.net-mvc entity-framework-core razor-pages select
asked by Ferdi

How do I access 2 DBContext in one Razor page

In my Razor page I would like to use a second DBContext that is connected to a different database....I have two DBContext that are connecting to two different database that work fine independently in the same app. DB1 is connected to MS Sql Server running...
asp.net-core entity-framework entity-framework-6 razor razor-pages
asked by Thomas

Issues with binding multiple objects on a razor page

I am trying to build a razor page that allows the user to edit a number of different objects on a single page - specific tests to be run in a lab under a single test run. I have been running around in circles, and have now got to a point where: 1. Posting...
c# entity-framework-core razor-pages
asked by L Robbins

Problem running project after Identity scaffolding in ASP.NET Core MVC project on Linux

I've tried adding ...<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="2.2.0" /> ...However 2.2.0 is the latest version available at this time, which doesn't match the error. The error is still the same after rebuilding the app....pr...
asp.net-core-identity asp.net-core-mvc c# entity-framework-core razor-pages
asked by Juan Gallardo

Adding a new child data item with Razor Pages, AJAX and and Entity Framework Core

Coming from ASP.NET WebForms and feeling a bit overwhelmed. I have an ASP.NET Core Razor Page that loads an incident and all the comments related to that incident. I figured out how to refresh the comments with a partial Razor Page and AJAX, but also want...
ajax asp.net-core c# entity-framework-core razor-pages
asked by DakotaPaul

Entity Framework Core: Including lookup data from an SQL view to display in Razor Page

New to Entity Framework and am trying to include data from an SQL view, which is a list of site codes and names. I'm currently trying to list all the ...Incident...s but display the site name instead of the site code. I started with ...Incident.Site... be...
asp.net-core c# entity-framework-core razor-pages
asked by DakotaPaul

updating data on one to many relation in EF core

I'm trying to update a table(FlightClasses) with multiple rows having relation of one to many with table(Flight) but i can't update it with the changed values Can anyone help me with that ...Model class of Flight i want to update rows on other table of f...
asp.net-core asp.net-core-mvc c# entity-framework-core razor-pages
asked by Abdul Rahman Maqbool

Unable to identify where to enable the FirstOrDefaultAsync method for a ASP.NET Core model

I'm having difficulty identifying where in a ASP.NET Core app we specify that a model can have the FirstOrDefaultAsync method enabled. I've previously scaffolded two models to razor pages, and for those I can write async method like so:...component = awai...
asp.net-core c# dbset entity-framework-core razor-pages
asked by Roshan Manuel

How to merge two similar database tables into one SelectList

I have two database tables that each have two columns that are the exact same -- Name and Designator. I want to create a SelectList combining the two tables using Designator as the value and Name as the text. This is what I've tried, but the options come ...
asp.net-core c# entity-framework-core razor-pages selectlist
asked by linus72982

Finding Max Date using Entity Framework Core - in Razor Pages

I am building a Razor Pages web application that would register a user into an exam. The ...ExamRegistration... Model has a field called ...MaxDateForExam... that can be nullable as this is a new feature added to existing database at a later time. When ...
entity-framework-core razor-pages
asked by Richard Armstrong

I use Distinct in my complex lambda query but is not work

I want to search from two Table that have no any relations these are my tables... public class News { public int Id { get; set; } public string Title { get; set; } public string FullText { get; set; } } public cl...
asp.net-core c# entity-framework-core linq razor-pages
asked by sunny

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!