Questions tagged [c#]

C# is a multi-paradigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform. Use this tag for questions related to C#. In case a specific version of the framework is used, you could also include that tag; for instance .net-2.0.

625 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Implementing an RSVP Event App in C#

I'm creating an RSVP-type application which will later be implemented in a mobile application I'm making. In this mobile application the user can select different events around their area and can ...
0
votes
0answers
34 views

Initializing Google APIs serverside in MVC controller

I have this code in my MVC Controller: ...
0
votes
0answers
29 views

Make touch drag more intuitive/smooth for AR-Application in C#

I am currently working on an app to augment pictures on a vertical plane. Once the vertical plane is placed, the user is able to put an object on the plane. The placed object can be selected and ...
0
votes
0answers
91 views

LeetCode: Course Schedule II C#

https://leetcode.com/problems/course-schedule-ii/ Please review for performance, please pay attention to the DFS function can this is be optimized? There are a total of n courses you have to take, ...
0
votes
0answers
31 views

LeetCode: Delete Nodes And Return Forest C#

https://leetcode.com/problems/delete-nodes-and-return-forest/ Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are ...
0
votes
0answers
34 views

Handling disconnected entity scenario in Entity Framework Core

As some you you may know, handling disconnected entities in EF can be a bit of a headache. After a really long weekend, I managed to make it work for my use case and refactor the code to the best of ...
0
votes
0answers
44 views

LeetCode: Sliding Window Median C# Minheap + MaxHeap

https://leetcode.com/problems/sliding-window-median/ Please review for performance. and coding style, no need to review the max and min heaps. median is the mean of the two middle value. ...
0
votes
0answers
555 views

Chart.js - Getting data from database using sql server and asp.net mvc5

I displayed and styled the chart.js and am also using mock data in the array, I just can't get my head around how to populate the data in the chart.js using MVC 5. I have tried lots of different ...
0
votes
0answers
62 views

GCD Groups with list

We have a list. divide the list element into two groups such that when the product of the numbers of two groups is taken and their GCD is calculated, it came out to be 1. Answer the number of ways in ...
0
votes
0answers
277 views

Bank ATM App Mockup - Implementing Domain-Driven Design (DDD)

There is a follow-up on this question. I have created this bank ATM app mockup which I believe implement some Domain-Design Design layered architecture, repository pattern and uow pattern, if not ...
0
votes
0answers
103 views

Entity Framework C# updating an entity list generic solution

I have an entity which has a list of other entities in it. for example: class Library { public virtual List<Book> Books{get;set;} } And I would like to ...
0
votes
0answers
56 views

Using System.Security.Cryptography.Aes to generate encryption key

Is the below method a safe way of generating a random encryption key to be used with AES (SymmetricAlgorithm) in .NET? It essentially piggybacks off of the Aes alg to create a random key, trimmed to ...
0
votes
0answers
3k views

Using RabbitMQ in asp.net web api

Use case : I have a Order web Api which creates an orders and publish the order to messaging queue. Notification service (web api 2) consumes this message by subscribing to the messaging queue and ...
0
votes
0answers
3k views

Bank ATM in C# Console Project

Sort of completed my bank ATM in C# console project. What do you guys think of the structure/design of this whole solution? There are 2 console projects ( Bank Admin and Bank Customer) and the third ...
0
votes
0answers
158 views

HttpListener Server for building reports in Excel

I have coded a web-based Excel file builder and sender, that serves the file over Http(example links in code). I would like to see improvements and any suggestions you might have. ...
0
votes
0answers
861 views

Upsert with .Net Core Web API

I am using .NET Core 2.2, EF Core and C#. I have created a web API project. I was requested to do an Upsert (insert or update). The entities structure is: Movie User Rating: this is used to give a ...
0
votes
0answers
68 views

Inject settings as a dependency, and serve them using a Web API

I used an opportunity to learn about Dependency Injection and DDD, therefore, althought any feedback is welcome, I am interested in feedback about those software design principles. I have a small ...
0
votes
0answers
221 views

DataTable extension methods and proper disposing of unneeded resources

I've build two extension methods, that allows me to show DataTable inside window. Below is my code: ...
-1
votes
0answers
55 views

How to use Dependency Injection properly in asp.net core?

I have a legacy Asp.net Core 3.1 application which uses Kestrel server and all our GET and <...
-1
votes
1answer
60 views

Adding a new class property == new API version?

I have the following code: ...
-1
votes
1answer
65 views

C# How to refactor my function code which speed up my function execution time

See the first block of code. here i am doing cross join between a ** list and datatable** from where i am calling a function called ExtractStandardValueFromLinkText this function has many loop which ...
-1
votes
1answer
139 views

ASP.Net Core API JsonPatchDocument

Hi I am creating a website for my chiropractor and I am creating the API for data access. I am creating a HttpPatch Method and want to know if this is the right approach so would be grateful if you ...
-1
votes
1answer
2k views

Ado.Net and Async insert of many rows to db

I have implemented repository in Ado.Net which insert data to many tables. I insert all in one transaction and use async/await to improve performances. If you have any suggestions have to improve my ...
-1
votes
1answer
3k views

ASP.NET MVC multi language website

What is the best way to make an ASP.NET MVC multi language website? The following code is what I use, but I need to make sure from your real-world experience that my code is the best way for ...
-3
votes
1answer
58 views

Find the starting index of all occurrences of a pattern within a string

...

1
9 10 11 12
13