Simple implementation of asp.net core
Trying to (re)find a github project which implemented asp.net from the ground-up in a simple fashion. It was more for learning than practical use.
Dapper vs. Entity framework?
I am a new developer and have just started developing .net web applications and confused on which one to use when retrieving data from the DB. What are the pros and cons of both? And what sources would you recommend I go through to get a grasp of the basics? Am leaning towards Dapper at the moment so where can I start?
Clarifying license with .Net Core
Hello,
I hope it's okay if I asked this here, having trouble undesrtanding how licensing works. Basically I made something with the .Net Core on linux and pushed my code to GitLab. The .NET Core Licene is MIT (https://github.com/dotnet/core/blob/master/LICENSE.TXT).
Does this mean now that I need to put the MIT License to my repo for my code since I'm using the platform? I haven't pushed any .NET Core source files but my code works with it. Can I license my part of the code with a different license, if so do I have to put a seprate text file and explicitly states what part of the code is licensed under MIT and what isn't?
Thanks
Lightweight alternatives to SQLite and Entity Framework for .NET/C# ?
Hello,
I am developing a tiny program for myself - single exe file, a few MB big. It's basically a glorified calculator with some data.
I thought to go with SQLite and Entity Framework, since the data and program are tiny I need a tiny database and since the database schema is not designed to ever be changed and I only need SELECT and UPDATE queries to be executed against it I thought Entity Framework would be best. I wanted to use EF to get some training on it and because in my opinion ADO.NET would not be better suited.
But since SQLite + Entity Framework = VS 2015 and I have 2017 and can't seem to get 2015 Community to run on my machine I decided I might look at some alternatives of these two.
For Entity Framework I have seen Dapper, OrmLite, NPoco, PetaPoco and Massive but they all look like ADO.NET with a different name. I'm sure they have their uses and cases where they would be better than ADO.NET but for my intents and purposes I don't think any of them are suited.
So, I'd like to ask for suggestions as to what database to use instead of SQLite that has to be just as light as it is, I don't need a 100MB overhead on a 3MB application just to connect to a database file (and it must be a file, no server to connect to) and what to use instead of Entity Framework that is not ADO.NET or ADO.NET with a different name.
Thank you!
Secure downloads in .NET
Has anyone got any examples of a secure download system in .NET, ideally MVC (or IIS I guess).
Scenario: A logged in user may have access to download a PDF
Many thanks
Signing JWT with ES256
I'm attempting to sign JWT using ES256 algorithm. I found decent code samples and tutorials, however when trying to run them I get the following error:
The specified key parameters are not valid. Q.X and Q.Y are required fields. Q.X, Q.Y must be the same length. If D is specified it must be the same length as Q.X and Q.Y for named curves or the same length as Order for explicit curves.
The code I came up with from misc. sources can be found in this gist.
I'm quite fresh to C# so pardon any beginner mistakes and teach me!
Also I can't use the Cng library because it's not supported on AWS Lambda where I'm trying to run the signing handler.
Question: Really worth come from java to .net core?
Hello everyone, thanks for the willing for help. I'm starting a new projects with two friends. We decided java with spring boot and other frameworks for the backend, because we have a knowledge with java itself, but not that much with spring and those 'new' technologies (mainly work with struts or jsf at work).
But one of the collegues suggested asp.net core, presented some templates, the incredible visual studio and i found myself a little balanced.
So I want to know, the real advantages working with .net core, comparing to java and what we have newer in the language.
The learning curve, we need to learn C# or we can jumpstart learning how to implement with the frameworks.
Thanks in advance, sorry if its not the place for that kind of newbie questions.
HTTP STATUS Code Standard of Restful API
https://ift.tt/2NN5FuZ HTTP STATUS Code Standard of Restful API Click hereASP.NET Core CMS With Decent Documentation
Does anyone know of, or work with, a cross-platform ASP.NET Core content management system with decent documentation? From my research, Orchard Core and Piranha CMS seem to be the most mature, but the documentation is severely lacking. Orchard Core has some detailed docs, but I don't see anything to help me get started.
For background I've been working with Umbraco for about 6 years now, and when I started there wasn't much documentation, but there was enough to get started. Once I had something up and running, I just started studying the source code. I've thought about building my own CMS, but would rather rely on a project that is well tested.
Question, not having much luck on stack overflow.
I'm currently trying to architect a application to host multiple websites from a single .net core application.
Ideally, I would like to show completely different Razor pages based on the domain name the application is being accessed from.
Ideally, I would like to have my razor pages broken down into areas, where each area is associated with a different domain name. IE www.domain1.com is the domain1 area, www.domain2.com is the domain2 area, and each area has it's own index about page etc.
So if someone accesses the application from www.domain1.com/aboutus , it would direct them to the razor pages located in the Area/Domain1/Pages/AboutUs section of my application.
Similarly if my application were to receive a request to www.domain2.com/aboutus, they would see the about us page located under Area/Domain2/Pages/Aboutus.
I've been searching for hours, and I can't figure out how you accomplish this using razor pages area feature. The only information I can find is how to accomplish this using areas with vanilla MVC.
This was a pretty good example.
https://stackoverflow.com/questions/49378474/different-domain-in-the-same-app-asp-net-core-2-0
I can't figure out how to accomplish the same type of thing using razor pages.
Customizing ASP.âNET Core Part 01: Logging
https://ift.tt/2Qh4EZb Customizing ASP.âNET Core Part 01: Logging Click here
Was WCF data services ever open sourced?
So I was re-reading this announcement from MS, that was posted on MSDN 4 years ago, and also some of the controversy it brought, and realised: Was WCF Data Services ever open sourced? I couldn't find anything Googling it and I tried github as well - if it wasn't open sourced, was there any reason why?
What's up with .net core
So I've been learning .Net for the past years and now I read that .Net core will replace it. Am I screwed? Can I transfer my skills in .Net to .Net core easily if I need to?
.NET Core 2 JWT Validation and Refreshing (using Auth0)
I have a question regarding working with Authorization in .Net. I am relatively new to this.
I have a web app using Auth0 (configured as regular web app) calling an API (also authorized with Auth0). I added the openid, profile, and email scopes when requesting and ID token. Following the tutorial on Auth0 (https://auth0.com/docs/quickstart/webapp/aspnet-core), I am also getting an access token on user login by saving the token by doing below.
//startup.cs
options.SaveTokens = true; options.Events = new OpenIdConnectEvents { OnRedirectToIdentityProvider = context => { context.ProtocolMessage.SetParameter("audience", "https://myapi/api"); return Task.FromResult(0); }; }
I call my API using a typed httpclient. I initialize the base URI and authorization header by getting the access token from the httpcontext and calling the appropriate URI for the API.
public RepositoryClient(HttpClient httpClient, IHttpContextAccessor httpContextAccessor) { _httpContextAccessor = httpContextAccessor; _httpClient = httpClient; var context = _httpContextAccessor.HttpContext; var token = context.GetTokenAsync("access_token").Result; if (token != null) { _httpClient.BaseAddress = new Uri("https://localhost:44335/"); _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); } }
I am able to access my API public and private methods correctly. In my API, the only validation is being done by the build in Jwt Middleware:
string domain = $"https://{Configuration["Auth0:Domain"]}/"; services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }).AddJwtBearer(options => { options.Authority = domain; options.Audience = Configuration["Auth0:ApiIdentifier"]; });
Based on this setup, do I need to do any additional validation? I read that the ASP .NET Core built in JWT Middleware will decode, validate, and do all the heavy lifting needed. All that is needed in the configuration above. Is this right or do I need to do any additional validation?
I am also not sure if above is using the Authorization Code Grant or Client Credentials grant type. With authorization code grant, you need to get an authorization code to get a new access token. Is this being automatically done on redirect to the Auth0 authorization endpoint?
If I want to get a new access token. how would I do it in this case where the user is already logged in? The only way I could get a new access token was by using client credentials grant (and I had to also authorize my regular web app in the auth0 API in order to even request a new access token). How do I go about it without a client credentials grant or is that not possible? Should I instead be getting a refresh token and going that way (by enabling offline_scope)? My web app will only be used when you have internet access so wanted to clarify.
Also in my repository client, I am not checking to verify that the access token has not expired. Should I always be checking this? I.e., is the correct thing to do to extract the access token, store in a secure cookie, validate expiry, get a new access token, and update the cookie?
If anyone could help me with above questions, that would be really appreciated.
Confused: Can a ASP.Net Core use .NET Framework 3.5 library
I have been reading an article: https://docs.microsoft.com/pl-pl/dotnet/core/porting/third-party-deps#net-framework-compatibility-mode
And I am confused - if i create a .NET Standard library that references .NET 3.5 library and then reference my wrappping library in ASP.NET Core, then will it work?
I'm familiar with VBA and I want to learn ASP.NET. should I just bite the bullet and start learning C#?
Title says it all. I see the Core seems to have a lot of features and little/no support for VB. Should I just give into C#? I'm getting the vibe that this would be the best investment of my time.
.NET Core to .NET
Hi, I'm a junior developer who's worked with .NET Core but have no experience with .NET. I was curious on this things that I should learn going into my new .NET "System Analyst" role. Any advice is helpful! Thanks!
Best practice updating a running asp.net core site on with nginx & kestrel?
I'm used to the world of dynamic languages like ruby and php where updating a site was simply throwing up a new version of the file and the site ran.
What is the best practice with asp.net core? If I just updated an image file and add it to the wwwroot folder nothing seems to change on the live site, is this intended behavior?
If I publish the code on my local computer and then update the dll's and everything in it's entirety on the server it usually seems to crash the site until I restart the kestrel process, which makes sense. But this results in downtime, what is the best process of doing this?
MSBuild: Preprocess file before sending off to compiler
So I'm using a really nice Gtk# binding for my project, and I'm using Glade for the GUI editing. When adding icons, the URI (in the glade XML) is relative to where the Glade file lives. But after editing, I have to manually go into the XML and adjust the paths so that .NET can locate where the images live. E.g.
I have this in the Glade XML after using the GUI editor:
<object class="GtkImage" id="photo"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="pixbuf">photo.png</property> </object>
But then I have to change the pixbuf line manually afterwards
<property name="pixbuf">PhotoApp/photo.png</property>
Is there some sort of way in my PhotoApp.csproj file I can add an MSBuild target to look for any lines with pixbuf in them, then do some REGEX magic to correct the URI path? Have to in and do editing like this is quite a pain in the but.
.NET Framework - September Quality & Reliability Rollup
https://ift.tt/2R4QMlW .NET Framework - September Quality & Reliability Rollup Click hereLooking for advisement on best way to implement this feature to MVC project
Hello everyone,
I currently have code that uploads a csv and processes the data and saves to a database. I'm looking to enhance this upload tool with the following features:
- Preview file and use drop down menus to map columns to database columns (I have this UI generating).
- Pass the whole file and the selected columns back to the server (I am stuck here.)
Feel free to ask for more explenation. I appreciate any help that anyone can provide here.
Learn about the Benefits of Dot Net Frame Work
https://ift.tt/2NrLVJ2 Learn about the Benefits of Dot Net Frame Work Click here
ASP.NET Interview Questions & Answers
https://ift.tt/2wljVRc ASP.NET Interview Questions & Answers Click here
Are there really that few?
Sup fellas,
I’ve looked everywhere to find me a f* programmer for a project. Couldn’t find ANYONE. It was really frustrating. I’m talking about a month of research, job postings, everything. Nothing came up!
In the end, we went with another programmer and we got the job done. But I was wondering, why are there so few? Where are they? Did I totally search in the wrong place?
Just sharing my frustration.
C# Journey into struct equality comparison, deep dive
https://ift.tt/2IosyiE C# Journey into struct equality comparison, deep dive Click here
Dot Net Training in Chennai
https://ift.tt/2Q8tURd Dot Net Training in Chennai Click here
How to use File Providers in ASP.Net Core
https://ift.tt/2R5dLxl How to use File Providers in ASP.Net Core Click here
WebAPI | Dependency Injection Problem
Hey everyone, we're working on migrating an existing Windows desktop application to a web application.
We are trying to use WebAPI as our entry point but having a bit of trouble.
Existing backend data access and business logic DLL's are being referenced by the new web api project (not project references). Using StructureMap to inject services from those DLL's.
Existing backend dependency injection is handled using Spring.Net.
We have a simple controller that is calling one of the simple services to retrieve some data.
When testing the API we're getting a json response but it is simply a null reference exception thrown against a property of one of the services injected.
So the injection of the service from the DLL into our web api is working ok, but that service's properties (handled by Spring.Net) are not being resolved.
Have tried google but it's kind of hard to summarize this problem into a search query. Anyone able to point me toward a resource that could help with this issue?
Any help appreciated!
How Microsoft rewrote its C# compiler in C# and made it open source
https://ift.tt/2R3Yzk3 How Microsoft rewrote its C# compiler in C# and made it open source Click here
Want to know more about JIT compilation? Come and read: [.NET Internals 09] Just-In-Time (JIT) compilation
https://ift.tt/2NEDdeV Want to know more about JIT compilation? Come and read: [.NET Internals 09] Just-In-Time (JIT) compilation Click here
Have Your Cake and Build It Too
https://ift.tt/2Qfbuyn Have Your Cake and Build It Too Click here
Is there a discord where we can help one another?
Hi, sometimes I just have small questions or need some quick help, but making a new post for it doesn't always seem to be the right thing. So is there some kind of Discord of Slack channel where we can help each other with questions and bugs?
EF Core. How to create proxy for POCO with own interceptors.
No text found EF Core. How to create proxy for POCO with own interceptors. Click hereEF Core best practices for returning nested JSON.
I have a client who needs a backend for an SPA that produces a specific JSON response. Something like this:
{ "avatar" : { "id" : 1234 "url" : "www.example.com/1.jpg" }, "dob" : { "month" : 1, "day" : 1, "year" : 1987 } }
Except with a lot more nested objects that contain properties for each user. To make a quick PoC so I can test, I created an avatar class, and a dob class etc, and linked them to the user. I'm wondering if this will end up creating unnecessary complex joins that will drag down performance at scale, and if there is a better or more standard way to return class properties in a nested format - it seems like kind of a waste to create a class to hold essentially 3 key value pairs for a date of birth. Any advice would be appreciated.
Here's what's new and coming to .NET Core with versions 2.1, 2.2, and 3.0
https://ift.tt/2xD7pgb Here's what's new and coming to .NET Core with versions 2.1, 2.2, and 3.0 Click here
.NET Framework September 2018 Preview of Quality Rollup
https://ift.tt/2Q54pjG .NET Framework September 2018 Preview of Quality Rollup Click here
EF core lazy loading for IQueryable.
How I сan create dynamic proxy for ef core that can contain virtual IQueryable. It will use lazy loading for IQueryable.
.NET Core 3.0 Alpha - WinForms and WPF (Windows only) • r/csharp
https://ift.tt/2QXORiN .NET Core 3.0 Alpha - WinForms and WPF (Windows only) • r/csharp Click here
Should I build my smaller side projects in .NET Core?
I come from a Ruby/Php background initially. I've been thinking of moving towards using the Microsoft tech stack permanently in the future at some point. So at the moment, I'm thinking of building some mini projects in C# to practice with.
However, it is my understanding that C# and .NET Core/Framework are usually built for enterprise level projects. If I wanted to create something simple like a basic blog, do you guys not think that building that in .NET Core is considered overkill? For example, opting to build a simple API in Ruby on Rails would be considered overkill because of its size and immense features and so a smaller library like Sinatra would be considered a better fit for that kind of project.
What do you guys think? Also, can you recommend a way to quickly setup a new project in .NET Core (beside the .NET CLI) to get the ground running on any projects I start, like a boilerplate of some sort. I would ideally want to start my projects in C# as swiftly as possible without too much configuring or overhead.
Any good example projects using ASP.NET Core with React?
I'm trying to learn how to use React with ASP.NET Core. I have some experience with ASP and Razor, but I'm beginner in terms of SPA frameworks and how to use them with ASP. I've read some tutorials, but these usually cover only a simple examples, and don't focus too much on the project structure. Can you recommend me some example Github projects which show how things should be done in a little more advanced scenarios?
New HashSet.TryGetValue(T, T) Method in 4.7.2
Small but handy (and logical) introduce of HashSet<T>.TryGetValue(T, T) method in NET Framework 4.7.2
How to find When was your database last used or accessed ?
https://ift.tt/2xk2oJn How to find When was your database last used or accessed ? Click hereIntroducing Microsoft Learn
https://ift.tt/2xR0RtI Introducing Microsoft Learn Click hereTaking the 70-487 (Developing Microsoft Azure and Web Services) in 5 days, any tips?
Hi,
I was wondering if anyone has a good study guide for the 70-487 or dumps to test my knowledge..
thanks!!
Using NuGet package in F#... help?
I posted this to r/dotnet instead of r/fsharp because this community seems a lot more active and, from what i understand, how package management works applies to many of the different .NET languages.
I'm a complete newbie to F# and the .NET ecosystem in general. I want to use Microsoft Research's Infer.NET with F# (which as shown is one of the options), but I can't get the NuGet dependency to work from Visual Studio. Whether I add it as a NuGet package to the dependencies of a F# project, or reference my local copy of the folder using #r @...., I get an error (screenshot below). Can anyone resolve this? Any help would be greatly appreciated!
How heavy is Graphics.MeasureString?
I have an MVC app and I've got to a point where I need to measure a bunch of strings using the graphics object.
I was wondering how efficient is Graphics.MeasureString? Will measuring a bunch of strings grind my app to a halt?
Introducing Azure Functions 2.0
https://ift.tt/2OKOKG4 Introducing Azure Functions 2.0 Click hereWhat is the best way to take a JSON object and turn it into XML
I currently have a JSON payload from my LinkdIn profile which I would like t turn into a CV. I plan to use Aspose in order to convert the XML to a PDF file which the user can then download. What is the best method of taking JSON from a hidden object on a HTML form and transforming this?
