Skip to main content

All Questions

Tagged with
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 ...
Tobias's user avatar
  • 15
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 ...
Ardian Idrizi's user avatar
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; } ...
Tobias's user avatar
  • 15
-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 ...
PackJC's user avatar
  • 1
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 ...
remdon's user avatar
  • 23
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 ...
Антон Ласько's user avatar
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 { ...
Coder6652's user avatar
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)] ...
Fernando Fiore's user avatar
-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}" "...
Nathan Camargo's user avatar
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 ...
Paul Falaju's user avatar
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 ...
Joshua Peacock's user avatar
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 ...
Morgan's user avatar
  • 27
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 ...
Thomas Adelaars's user avatar
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 ...
Thomas Adelaars's user avatar
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 ...
jack's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
40