Data dodania Pytanie
2017-04-18 00:04 asp.net core testing controller with IStringLocalizer »
I have controller with localization public class HomeController : Controller { private readonly IStringLocalizer<HomeController> _localizer...
(1) odpowiedzi
2017-04-17 19:04 Submitting multiple files to ASP.NET controller accepting an ICollection<IFormFile> »
In my ASP.NET Core backend, I have a controller function that looks like this: [HttpPost] [Route("documents/upload")] public async Task<IActionRes...
(1) odpowiedzi
2017-04-17 19:04 Convert string to int, check total sum of int based on foreach loop »
I've seen what seem to be similar questions on here but they all seemed very contextual and I've so far had some trouble figuring this out. Still pret...
(1) odpowiedzi
2017-04-17 18:04 C# Regex change replacement string for each match »
I have a string like this: string s = "<p>Hello world, hello world</p>"; string[] terms = new string[] {"hello", "world"}; I want to do...
(1) odpowiedzi
2017-04-17 18:04 WebApi 2 AssemblyResolver »
I have created a controller assembly containing all my controllers in WebApi 2.0 and followed this article - https://www.strathweb.com/2013/08/customi...
(1) odpowiedzi
2017-04-17 16:04 Trouble getting post variables from row-based elements »
I am working on a "Survey" application in MVC 5. Basically it's an application to support surveys for users to fill out. The user can also go back at ...
(1) odpowiedzi
2017-04-17 15:04 Does a .NET SqlDataReader object use a database cursor, or the whole result set is loaded into RAM? »
Here is a sample code of using the SqlDataReader: // Working with SQLServer and C# // Retrieve all rows cmd.CommandText = "SELECT some_field FROM dat...
(1) odpowiedzi
2017-04-17 10:04 Decimal.MinValue costs more than you expect »
Recently during profiling session one method caught my eye, which in profiler's decompiled version looked like this: public static double dec2f(Decim...
(1) odpowiedzi
2017-04-17 09:04 Why razor is rounding to a decimal type to 2 decimal places automatically? »
This is the field I have in my View Model: public decimal MyValue { get; set; } Here is how I show the value in a View: @Html.EditorFor(model =&gt...
(2) odpowiedzi
2017-04-17 06:04 How to turn autocomplete off and prevent pre-population of a field »
How do I prevent my Username and Password ASP.NET/C# TextBox fields from getting pre-populated in Chrome, even if Google Smart Lock has saved it. I c...
(2) odpowiedzi
2017-04-16 19:04 What does the ref keyword mean before the return type in C# »
In the code below, what is the significance of the ref in the GetAge() method signature? public class Person { private int age; public re...
(1) odpowiedzi
2017-04-16 16:04 Form POST parameters wrong generated after return view »
So I have this CSHTML: @using (Html.BeginForm("DeleteProduct", "Shop", FormMethod.Post)) { @Html.Hidden("productId", product.ProductId); @Htm...
(2) odpowiedzi
2017-04-16 16:04 Async .net web api sometime does not return any result with angularjs call by passing same id parameter »
Async .net web api sometime does not return any result with angularjs call. May be due to some problem with my asynchronous code handling at UI end.C...
(3) odpowiedzi
2017-04-16 09:04 Inserting c# char variable data to ADO Char(1) field »
I am experiencing this rather weird decimal addition to my char value during the conversion. Tried the following conversion but the decimal value ju...
(2) odpowiedzi
2017-04-16 03:04 Why is Get written before Set in classes almost all the time, is there a reason? »
So for a while now as i am self taught i have been writing Set before Get in my classes. public class Foo { public string Name { set; get; } } I'...
(1) odpowiedzi
2017-04-15 18:04 Console application (C#) is stuck while interaction »
I’m writing console application which does some work by scheduler and write output to console. Everything is good but when I click on the console it...
(2) odpowiedzi
2017-04-15 16:04 Why is this method accepting byte, when it's parameter is double? »
First, I want to say that this is just a simple code, it's an example and I am studying for a exam. public class TOblik { public int povr...
(1) odpowiedzi
2017-04-15 12:04 Custom ASP.NET Core route with id and title separated by hyphen »
In ASP.NET Core, I want to generate some kind of SEO-URLs, that contains the id of an entry and also his title. Example: example.com/News/ViewNews/12...
(1) odpowiedzi
2017-04-15 11:04 Null response from API in Angular »
Learning Angular 2 and building an app with .Net Core I've an API from which json response is passed to Client Side. In my Angular2 service, used Obse...
(1) odpowiedzi
2017-04-15 10:04 Should I call ConfigureAwait(false) on every awaited operation »
I read this article https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html - however I'm seeing a contradiction: I'm aware of the probl...
(1) odpowiedzi
2017-04-15 10:04 Where to use db context for viewmodels in MVC »
The Controller should not directly use the DB context, and the respository should not know about view models (representation). The underlying issue ...
(2) odpowiedzi
2017-04-15 01:04 How to enable a file download via anchor in MVC »
I have the following: <a class="download" href='/doc.txt' download>Download txt</a> And this file is in the root of my web project. ...
(1) odpowiedzi
2017-04-15 01:04 Controller response after select one value of select option »
Context I have two tables: Firmtable : ID (string), Firm(string) Firms table: FirmID(string FK), Name(string) That I want to do is to select one v...
(1) odpowiedzi
2017-04-14 23:04 Leaderboard, rank query, how to return the rows above/below a users rank »
Given this query, if I want to pull the rank of a specific individual where I know there $name and $score and return the rows above/below that rank (s...
(1) odpowiedzi
2017-04-14 23:04 How to create Asp.net mvc secure login page authentication? »
Hi I have an important task while being completely lost. My team is building an external website and have already purchased the certificate. I am lo...
(2) odpowiedzi
2017-04-14 19:04 Can I tell MVC to separate pascal-cased properties in to words automatically? »
I often have C# code like [DisplayName("Number of Questions")] public int NumberOfQuestions { get; set; } Where I use the DisplayName prop...
(0) odpowiedzi
2017-04-14 19:04 How to support structurally-typed in a nominal-typed language? »
In F#, Nominative or Structural?, the answer said that I can trick F# to work like a structurally-typed language via some exotic mechanisms. How can I...
(1) odpowiedzi
2017-04-14 18:04 How to create a Countdown (javascript ?) in Razor? »
I am trying to create a auction site ASP.net MVC using on Razor, But I want to create a countdown on my list of bid items. How do I put a countdown in...
(1) odpowiedzi
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