set variable of partial class
I have a generated clas (with soapui) I need to pas data to a class order This class has partial classes The code : This is what i try and th error i get .... Dim orders(1) As dpd_label.order orders(1) =…
Passing multiple Lists in single parameter
Hi Team I have below requirement. ' There are 3 list with different class type. Example: List<Customer> lst1=new LIst<Customer>(); List<CustomerOrder> lst2=new List<CustomerOredr>(); List<CustomerTransaction>…
Sample code Asp.Net Core Datatables Jquery pagination MVVM Services
Hi, I would like a template sample code to get started, with Asp.Net Core CRUD operations with search pagination , master detail pages. Dependency Injection CODE FIRST ENTITY Framework Datatables Jquery I have a solution developed on…
EF Core 5 many-to-many disconected add/remove without join entity class
EF Core 5 introduced many-to-many by convention, we only need to add the collection navigation property on each side and it works. I know I can query one side of the relationship, add it to the collection property and save it, but this requires an…
Receiving chat messages with SignalR
I tested the SignalR solution in Xamarin Forms and .net core backend and it works great: https://montemagno.com/real-time-communication-for-mobile-with-signalr/ However, I am wondering how to keep receiving the messages when the app is in background…
EF Core question regarding relations
I'm building a ticket system. I have two models: User and Ticket. A user can have multiple tickets, and is bound to the ticket via the Customer_Id field. Another user, with the role of Practitioner, can also be assigned to the ticket, via the…
Where to store xamarin forms chat messages
Hi, I need to implement a chat service in my app. Before I get too far on this, I would like to ask for an opinion on where to store chat messages. My options so far are: Twilio chat My own DB There are pros and cons, Twilio chat costs…
Creating a generic template in C#
I have researched that C#, as well as its predecessor, C++, enable users to create generic templates. Here are the two source code snippets below: using System; using System.Collections.Generic; using System.Data.OleDb; using System.IO; namespace…
Error adding migrations: Failed to create CoreCLR, HRESULT: 0x80070057
I'm having an issue whereby I get the error message: Failed to create CoreCLR, HRESULT: 0x80070057 when I use any of the entity framework tooling. I have 2 projects in my solution an ASP.NET Core (.NET 5) Web API and a .NET Standard 2.0 Class Library. …
Spatial data operations
Hello, I have to migrate some routines written in VBNET in WPF environment on AZURE (webapi net core). In these routines spatial operations such as union, intersection, etc. take place. here is an example: Private Sub example(ByVal sender…
AddDbContext<TContextService, TContextImplementation> don't use DI to create the db
In my project I have created this DbContext derived class: public class SqliteContext : DbContext, IRepoContext { private readonly string _fullname; public SqliteContext() { _fullname = SqliteHelpers.CreateDbFullName(); } …
Linq Error when migrate entityframeworkcore 2.2 to 3.0
Hello, i am migrating from netcore 2.1 to 3.1. of a solution hosted on Azure. I have encountered many errors due to entityframeworkcore 3. Queries such as DBe.BmsListaInfrastructure.Where (e => e.Amministration == Administration) .ToList (); …
How to pass datatable from c# class to MSSQL Server stored procedure using Entity Framework Core 5.0.1.
I have a data import application written in .Net Framework to migrate to .Net Core. The application uses a c# class to pass a datatable as an input parameter to a MSSQL server stored procedure. The code in EF6 works fine and is pasted below. …
Code first Unique constraint on multiple columns
Say I want a Microsoft SQL Server entity as follows: CREATE TABLE [dbo].[Entity]( [ID] [int] IDENTITY(1,1) NOT NULL, [COL1] [nvarchar] NOT NULL, [COL2] [nvarchar] NULL, [COL3] [nvarchar] NULL, CONSTRAINT [PK_Entity] PRIMARY KEY CLUSTERED Then…
DbContext lifetime in desktop app with SQLite
I am creating a small data-driven desktop application using .NET 5 with WPF, ReactiveUI, Dynamic Data, and EF Core 5. The app uses a local SQLite database to store all persisted state, and relies heavily on dependency injection. I would like to share…
Having trouble with foreign key in entity, can't track because the FK is already part of another object
Scenario: I have an entity that is central to the business, let's call it Company. Entity Foo has FK CompanyID, as does entity Bar. If, within the same context, I retrieve Foo and create an instance of Bar, then try…