New answers tagged

0

You can mix and match, but you may get a lit of runtime DLLs added to older .net projects. See here for examples https://www.hanselman.com/blog/ReferencingNETStandardAssembliesFromBothNETCoreAndNETFramework.aspx https://weblog.west-wind.com/posts/2019/Feb/19/Using-NET-Standard-with-Full-Framework-NET


0

First of all, I think you are confused about terminology. Two possible compilation targets are ".NET Framework" (owned by Microsoft and developed for Windows) and ".NET Core" (which is open source and cross-platform). ".NET Standard" isn't really a compilation target-- there is no such thing as an assembly "compiled in .NET standard." It is a specification ...


1

By defition the dependency injection is a pattern. The ASP.NET Core is built around dependency injection as it allows great flexibility in the framework. In a plain .NET Core application, the DI pattern can be used and also overused. As with any technology and patterns, in may be used inapropriately. This depends on your application and must be evaulated ...


1

Your code is contradictory. Here, you state that the content of your ITypeAData object is intended as a read-only value: public interface ITypeAData { int Value { get; } } Here, you clearly intend to be able to set the value of your ITypeAData content: (dataManager.TypeAData as TypeAData).Value = 0; This is contradictory. Either it's intended to ...


8

Since you write that you're a .NET developer and you don't even mention F#, odds are that you're a C# developer. In that case, I'd strongly suggest that you learn F# first. It's another .NET language, and it's a great stepping stone for anyone coming from C#. In itself, it's a great FP language, but it also offers full interoperability with the existing ....


5

I have never personally met anyone who working with functional programming language in their day today job. I am paid to write OCaml, AMA! My main reservations are on whether Haskell is a good language to start with and whether it is actually used anywhere in the industry. Haskell isn't a great language for your first language, but it is a very solid ...


0

I would use guard clauses as in this example so parameter checks can be reused. In addition, you can use the builder pattern so more than one validation can be chained. It will look a little bit like fluent assertions.


0

What we like to do for business logic errors (not neccessarily argument errors etc.) is to have a single enum that defines all potential types of errors: /// <summary> /// This enum is used to identify each business rule uniquely. /// </summary> public enum BusinessRuleId { /// <summary> /// Indicates that a valid body weight ...


2

Api.EmployeeController.Update(Api.EmployeeUpdateDto) => Services.EmployeeService.Update(Service.EmployeeUpdateDto) => Data.EmployeeRepository.Update(Entities.Employee) => Data.EfDbContext.Employees.Update(Entities.Employee Let's look at it this way: what if you were to tell your business counterpart this? Just the above word-for-word. I would wager he/she ...


0

What I see here, that you want to catch a subset of possible errors and you rethrow what you did not want to catch. The right solution would be not catching what you don't want to catch, so you won't need to rethrow it. I am not sure what C# allows, because I never worked with that language, but my guess would be that wrapping your treatable exceptions with ...


2

Ultimately, it depends on your requirements, specificially how often and for what reasons do you expect the application to lose the ability to reconnect? is it reasonable to assume a reconnect will be possible some minutes later? how much data can get lost in case there is unsaved data, and how important could that data be? Depending on the answers to ...


1

By exposing TcpListener.Pending() on my APIServer, I was able to resolve this. APIServer.cs TcpListener server; public bool Pending { get { return server.Pending(); } } Unit Test [TestMethod] public async Task Start_TwoConnections_ClientsIsTwo() { ...


0

I found the solution to this after a lot more Google searching. Eventually I was led here: https://stackoverflow.com/questions/55188636/graphql-net-how-to-separate-the-root-query-into-multiple-parts According to the docs the root query can be split into virtual groups: public class RootQuery : ObjectGraphType { public RootQuery() { Name = "...


1

While trying to improve my applications' simple searches to bigrams and trigrams from unigrams, essentially, I saw your question. If one of requirements is ability to query a distributed file system or database, then this might be interesting for you too: the paper Pibiri and Venturini 2018 "Handling Massive N-Gram Datasets Efficiently" outlines an ...


1

Is it general practice in Software industry to copy the Database layer into another Copy layer with Computed Members? Example: New class layer would contain all existing members, plus these added in a class, etc. FullName => FirstName + LastName AccountValue => Quantity * StockPrice What you're seeing used here is the distinction between ...


0

Yes this is common practice. It seems weird with EF because EF makes objects for you. If you were just using SqlClient with DataReaders and the like directly you wouldnt think twice. The problem is the EF objects are often tightly coupled to EF via attributes. This means wherever you use the Object you have to reference EF. Which you don't really want to ...


0

Asp.Net MVC is strongly inspired by frameworks like Django and Rails originating from dynamically typed languages. Therefore it adopts a number of patterns and conventions which feel a lot more dynamic than what is usual in the .net culture, for example heavy use of reflection and dynamic objects. This was probably a deliberate strategic decision by MS ...


1

The point of async is to allow the thread to perform other work while waiting on slower services/devices to repond. So is your thread needed to perform other work? If it is, then async/await is one way to free up your thread. If it is not, then using async/await only makes your system more complicated without any real benefit.


4

This is not an authorization problem; it is an accounting problem. The subscription is for your company's product. These transactions are sales. This is your core business. I would do a deep dive with the product owners to uncover potential use cases for: Customer onboarding Rate limiting (your question) Invoicing and auditing Customer support Refunds or ...


Top 50 recent answers are included