All Questions
Tagged with razor entity-framework
594
questions
0
votes
1
answer
40
views
How to establish n:1-relation with Razor/Entity Framework
I'm working with VS 2022 for Mac 17.6. My current project is Razor web app with .NET 7.0 and Entity Framework with SQLite.
This is what I want to achieve: in my data model I have, among others, two ...
0
votes
0
answers
54
views
WEIRD problem inserting in database using Entity Framework in ASP.NET MVC using C#
Basically, I'm writing an ASP.NET MVC project using Entity Framework, I have downloaded template, and there is a Contact session, I have created model, base class etc...
But the problem is that I ...
1
vote
1
answer
201
views
Is it possible to scaffold CRUD razor pages that implement a dropdownlist for display/selection of dependent entities?
I'm working with VS 2022 for Mac 17.6. My current project is Razor WebApp with .NET 7.0 and EntityFramework with SQLite.
This is my DataModel:
public class Role
{
public int Id { get; set; }
...
-4
votes
1
answer
111
views
Is using Try/Catch to pseudo-synchronously make Asynchronous API calls proper?
I am wondering if this is the proper way to achieve what I am trying to do.
POST Schedule to database
GET Items that relate to Schedule ( Must be done after schedule POST )
Should each operation ...
1
vote
0
answers
95
views
How do I compare two different data in one table using Blazor?
Problem solved:
Instead of using two dynamic lists, only one list is needed:
ObeservableCollection<dataClass> currentList { get; set; } = new ObservableCollection<dataClass>();
The ...
0
votes
2
answers
94
views
Razor ASP.NET: update statuses for few instances with 1 POST request
I have a Model SkillStatus with fields ID, EmployeeID, SkillID and Status. I want user to have a possibility to view statuses of Employee`s skills in one page and change one or few statuses. To do ...
0
votes
0
answers
150
views
EF Core and Lookup table with multiple columns
I have the following entities as follows:
public class ParentOfAddress
{
public long HouseId;
-- some other properties
public HouseAddress address;
}
public class HouseAddress
{
...
0
votes
0
answers
250
views
How do I create a questions and answers razor pages in ASP .NET Core?
I've added two model classes Question and Answer, where one Question has many Answers.
public class Question
{
[Key]
public long IdQuestion { get; set; }
[Required]
[MaxLength(100)]
...
-2
votes
1
answer
109
views
Why am i getting this CS0246 errors? Razor Page
enter image description here
#pragma checksum "C:\Users\Nathan\Documents\ASPNET PJ\Views\Contato\Criar.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "...
0
votes
1
answer
60
views
ModelState.IsValid remains false for DropDownList, even though values to properties are binded and passed to the HttpPost method
I am not sure why the ModelState validity checks keep returning false, hence preventing a write to DB action, even though values supplied to all the properties are of right DataType and successfully ...
0
votes
1
answer
156
views
Model Binding with List of Objects Not Working
Model binding a List of objects is not working as expected.
When entering the OnPost method the UploadTransactions List is not null, but an empty list.
I have followed the instructions outlined here
I ...
0
votes
1
answer
453
views
How do I prevent a duplicate entry for a Create/Edit Functionality in ASP.NET Core w/ EF?
I am trying to prevent a user from creating a form with a FirstName, LastName, and DOB that match an entry in the database and editing a form to match an existing entry. If you could also lead me to ...
0
votes
1
answer
59
views
Use selected item from DropDownList to query another table and fill textboxes
I want to get the description and price of the selected artikel, but i want to be able to edit it afterwards so for example you have a standard price which can be adjusted.
Here is what my database ...
0
votes
0
answers
52
views
Use selected item from DropDownList to fill in Textboxes in ASP.NET MVC
This was automatically generated
Now i want to get the owners name that paard(horse), but be able to edit the owners name after selecting the horse.
I've tried searching everywhere, but i couldn't ...
1
vote
1
answer
603
views
How to share dbcontext to entire razor web application?
I read alot thread said in aspnet to share connection database to controller and page is through dependency injection. so i follow this tutorial tutorial. but after implement this. dotnet-ef ...