Data dodania Pytanie
2017-04-14 16:04 Access to F# record base properties without using interface »
F# records cannot be inherited, but they can implement interfaces. For example, I want to create different controllers: type ControllerType = | B...
(2) odpowiedzi
2017-04-14 15:04 How to make a List variable constant in ASP.NET »
In this code, I am trying to check what rooms are available at the time that has been entered by the user. To test whether the room is free, I change ...
(2) odpowiedzi
2017-04-14 14:04 How to split a string on the 3rd occurence of a char C# »
I was wondering is there a way to split a string on the 3rd occurence of a char? When splitting previously i was using: line.Substring(line.LastIndex...
(9) odpowiedzi
2017-04-14 03:04 How to read ASP.NET Core Response.Body? »
I've been fighting with this for a while and the only solution I've been able to identify is a hacky workaround that includes swapping out Response.Bo...
(2) odpowiedzi
2017-04-13 23:04 Can I simplify this C# 7 switch statement to not re-state the type? »
I'm looking at C# 7's new switch statement, and while it's awesome that I can switch on the type as part of pattern matching, I wonder if I can avoid ...
(2) odpowiedzi
2017-04-13 17:04 How to mimic the aspnet mvc code for LabelFor? »
My "unenhanced" code looks like this: @using (Html.BeginForm("Index", "home")) { <!-- old group --> <div class="form-group"> ...
(2) odpowiedzi
2017-04-13 15:04 Angularjs with browsersync post method send as options »
I have an Angular 1.6.4 application using Browser-sync with gulp. When uploading the Browser-sync with the command "gulp server" and when making a pos...
(2) odpowiedzi
2017-04-13 11:04 How to generate URL using Html.ActionLink with Forward Slashes instead of QuestionMark »
I am trying to generate the URL with forward slash like the following @Html.ActionLink("Details", "Details", new { id = item.StudentID, name = item.F...
(1) odpowiedzi
2017-04-13 10:04 C# How to expose the constructor of a nested class only to the members of the parent class? »
Basically what I want to do is class Parent{ public class Nested { private Nested(){ //do something } /* ...
(1) odpowiedzi
2017-04-13 09:04 Order of execution when using object initializers »
This morning I encountered an interesting situation in an application I'm building. Even though I've resolved this in another way, I'm interested in f...
(1) odpowiedzi
2017-04-13 05:04 Why C# "using aliases" are not used by default? »
Consider the following code. using System.ComponentModel.DataAnnotations; namespace Foo { public class Bar { [Required, MaxLength(25...
(1) odpowiedzi
2017-04-12 23:04 MySQL Error with ASPCORE using C# »
I have a data base with three tables. Users, messages and commits. The site boots up and I can login and register just fine When I go to post a messag...
(0) odpowiedzi
2017-04-12 20:04 How to mask Password in MVC ViewRazor »
I need to mask Password in View in MVC Project, where i have list of users. Model: [Required] [StringLength(50)] [DataType(DataType...
(2) odpowiedzi
2017-04-12 15:04 Override Lifetime in ASP.NET Core Dependency Injection »
I've registered an Entity Framework DBContext using standard code like this: public void ConfigureServices(IServiceCollection services) { [...] ...
(1) odpowiedzi
2017-04-12 14:04 Is there a way to run async lambda synchronously? »
Is there a way to run async lambda synchronously? It is not allowed to modify lambda expression, it must be leaved as is. Copy/paste example(it's a...
(2) odpowiedzi
2017-04-12 14:04 C# WebAPI - Get full HTTP request »
In one of my WebAPI Controllers, I'd like to see the original raw HTTP request which was sent by the client (like the stuff you can see on http://web-...
(1) odpowiedzi
2017-04-12 11:04 JSON Object and Simple Type to Model in WebAPI using FromBody »
I am creating a Web Api method that should accept a JSON Object and a Simple Type. But all parameters are always null. My json looks like { "oldCre...
(3) odpowiedzi
2017-04-12 11:04 Strange output link in facebook api https:\/\/scontent »
I have a following question: when I query facebook graph api with this: WWW www = new WWW("https://graph.facebook.com/me?fields=picture&access_tok...
(1) odpowiedzi
2017-04-12 10:04 Does decompiled C# get reverse engineered from IL/MSIL? »
When I open a tool like ILSpy or dotPeek, I have an option of viewing decompiled C# or the IL. When you view the decompiled source, does the decompil...
(2) odpowiedzi
2017-04-12 04:04 Why does C# appear to partially un-escape command line arguments? »
I am trying to pass multiple paths as arguments to a console application but am getting an "Illegal characters in path" error. It appears that someth...
(1) odpowiedzi
2017-04-11 22:04 How to structure data validation in .net Core web API? »
I have a asp.net Core web API with the following structure: View Layer: API endpoints | V Controller Layer: Controller classes implementing e...
(1) odpowiedzi
2017-04-11 22:04 How do I access the request body as a stream, without waiting for the entire body? »
I have a Web API action that accepts large (100 MB+) files and forwards them to another HTTP service. I want to stream the request body to the other s...
(0) odpowiedzi
2017-04-11 22:04 Datatables AJAX Request - Unknown Length »
Have been really struggling with this for some time. Trying to get my datatable to populate, but am running into the following error: Uncaught TypeE...
(2) odpowiedzi
2017-04-11 20:04 How to dynamically load assemblies in dotnet core »
I'm building a web application, where I would like separate concerns, i.e. having abstractions and implementations in different projects. To achieve ...
(1) odpowiedzi
2017-04-11 15:04 Reflection: How do I find and invoke a local functon in C# 7.0? »
I have a private static generic method I want to call using reflection, but really I want to 'bundle' it inside of another method. C# 7.0 supports loc...
(2) odpowiedzi
2017-04-11 15:04 asp.net mvc view only returns when using for loop »
So I've been working on a simple asp.net application this week. And today I had a problem with a razor view not returning anything to my controller me...
(3) odpowiedzi
2017-04-11 10:04 Testing for 'lazy loaded' null IEnumerable in c#? »
I've simplified a piece of a deferred execution code, but how on earth do you check the following is not null/empty without wrapping it in a try/catch...
(4) odpowiedzi
2017-04-11 09:04 Why does AD3AD08 represent a valid date in the .NET framework? »
DateTime.Parse("AD3AD08") [2017-08-03 12:00:00 AM] Why does that string (which looks like just a normal hex string to me) get parsed successfully a...
(2) odpowiedzi
2017-04-11 08:04 How to get Enum value in Razor »
I used datatables and I want to get Enum value for a specified int variable. var client = $('td', row).eq(1).text().trim(); client is a number data...
(1) odpowiedzi
2017-04-11 06:04 Reference for Async LINQ in EntityFramework Core »
I used to include System.Data.Entity back in EF 6. Reading some StackOverflow posts, they recommend me to include Microsoft.Data.Entity but that refer...
(1) odpowiedzi
2017-04-10 22:04 ASP Razor adds whitespace to url »
I am using Razor 4.1x, and my url is of the form https://dev.mycompany.com. Razor renders the html page, and adds extra space to the url and new url l...
(0) odpowiedzi
2017-04-10 17:04 Google reCaptcha in Web API 2 c# »
I have an ASP.NET Web API 2 Project. I am trying to read Google Captcha from the form. I tried this Code: public string Post(FoundingRequest mod...
(3) odpowiedzi
2017-04-10 16:04 Create HTML-table from SQL, ASP.NET MVC »
Im trying to create a HTML table in my MVC application. The table contains the following: Each row is a service event for a specific. As you can se...
(1) odpowiedzi
2017-04-10 14:04 Proper way to manage test/prod connection strings in .NET web.config file »
I have the source code of an application that I maintain. In my web.config file, I have connection strings for both my test and production databases a...
(3) odpowiedzi
2017-04-10 13:04 Inject ApplicationUser in ASP.NET Core MVC »
I have a class that requires ApplicationUser (from ASP.NET Identity). The instance should be the current user. public class SomeClass { public S...
(1) odpowiedzi