dotnetomaniak.pl

Strona głównaUżytkownik

nocturn | użytkownik

nocturn
nocturn
1 321,25
490 dni, 6 godzin, 8 minut temu
4 grudnia, 2011
dotnetomaniak.pl

I usually pass configuration to my web API via JSON files, but recently I needed to pass them also via command-line arguments. As the solution for ASP.NET Core 2.x is quite different than for ASP.NET Core 1.x I decided to describe both methods in here.

Źródło: tpodolak.com
Dziel się z innymi:
[EN] ASP.NET Core - passing command-line arguments to Startup class

Web 480 dni, 23 godziny, 40 minut temu nocturn 77 rozwiń

I tend to do a lot of typos when I write a code and I mean a lot. This is quite annoying for me so I decided to somehow automate the process of finding the spelling errors during the build. My first thought was to use some kind of Roslyn analyzer, however, I failed to find any working one. This is why I decided to give a try to ReSharper Command Line Tools (also known as CLIT) combined with ReSpeller plugin. For those who don’t know, ReSharper Command Li...

Tagi: Cake, Resharper
Źródło: tpodolak.com
Dziel się z innymi:
[EN] Finding typos with ReSharper Command Line Tools, ReSpeller and Cake - .NET BLOG

Windows 560 dni, 23 godziny, 9 minut temu nocturn 78 rozwiń

If you were looking for information about API versioning support for ASP.NET Core you’ve probably come across Microsoft.AspNetCore.Mvc.Versioning library. The library itself allows you to set up versioning in a couple of different ways, for instance, via attributes or via manual convention setup. All of this options are really nice but unfortunately, they have one significant drawback, namely, you have to set them up manually. As I tend to forget about th...

Źródło: tpodolak.com
Dziel się z innymi:
[EN] ASP.NET Core - API versioning by convention

Web 742 dni, 22 godziny, 29 minut temu nocturn 76 rozwiń

In ASP.NET Coreweb.config is no longer a proper place for storing application settings. New framework introduces the concept of a json based configuration and the default file which stores the settings now is appsettings.json. Here is a quick tutorial how to use new features...

Tagi: aspnetcore
Źródło: tpodolak.com
Dziel się z innymi:
[EN] Asp.NET Core - populating IOptions from external data source

Web 811 dni, 13 godzin, 6 minut temu nocturn 54 rozwiń

Working with Tasks is a modern way of writing asynchronous code in an easy and flexible manner. It is quite straightforward to start using them, so usually developers do not investigate thoroughly the topic. Unfortunately this often leads to unpleasant surprises - especially when it comes to exception handling. Having this in mind let's take a look how to handle exceptions in Task and what can happen if we do it wrong.

Dziel się z innymi:
[EN] TPL - exception handling and UnobservedTaskException issue

Windows 1365 dni, 14 godzin, 56 minut temu nocturn 94 rozwiń

I am not a big fan of dynamic type in C#, however there are certain situations in which it can be handy. Let's assume that we have following piece of code (which I encounter quite often at my work) public abstract class Weapon { //some properties } public class Gun : Weapon { //some properties } // more derived types var weaponService = new WeaponService(); IList

Tagi: .NET 4.0, C#, dynamic
Dziel się z innymi:
.NET Blog: Dynamic type can be useful

Windows 1457 dni, 13 godzin, 2 minuty temu nocturn 243 rozwiń

Although ECMAScript6 has not been officially released yet, we can play around with new language features today. There are tools such as Traceur or Babel which are able to convert ECMAScript6 into ECMASciprt5, thus we are able to run the code in every browser. So let's try to run the snippet below, which leverages destructuring assignment using those tools ...

Dziel się z innymi:
[EN] .NET Blog: Using ECMAScript6 today

Web 1490 dni, 23 godziny, 46 minut temu nocturn 87 rozwiń

One of the features I miss the most in AngularJS is ability to easy unsubscribe event handlers. There is no convenience function opposed to $on, so in order to unsubscribe event, we have to call method returned by $on function (function () { angular.module('app.download', []) .controller('downloadCtrl', downloadController); function downloadController($scope) { // keep the unsubscribe function in local variable var afterRenderUnsubscribe = $scope.$on('afterRender', onAf...

Dziel się z innymi:
[EN] AngularJS - extending existing services using decorator

Web 1537 dni, 20 godzin, 23 minuty temu nocturn 83 rozwiń

There are couple of ways of injecting dependencies into AngularJS components. The most common one is just to specify the dependency name in the function's argument list (function() { angular .module('app') .controller('shellCtrl', function ($scope, $http) { $scope.title = "Title"; }); })(); However this technique fails in real life scenarios, because for production we usually (or rather always) minify and uglify javascript files. Uglify proces renames our varia...

[EN] .NET Blog: AngularJS - dependency injection

Web 1544 dni, 9 godzin, 32 minuty temu nocturn 157 rozwiń

Borys najlepiej dryblował, Cybor kręcił najlepsze rogale, było kilku kajtków, którzy robili 200 kapek. Alternatywna recenzja książki Amy Hoy. Czyli rzecz o dostarczaniu.

Oskar at .NET: Borys najlepiej dryblował

Sztuka programowania 1562 dni, 19 godzin, 15 minut temu oskar-at-net 249 rozwiń

Let's assume that we have a simple table GL_Task which looks like this I was asked to rewrite simple SQL query SELECT Id,Name,IdProject FROM GL_Task WHERE Name = 'First task' OR Id IN (3,4 /more id's to come/) using NHibernate's QueryOver API. As simple as it may seem, solution for this particular problem is not straightforward. My first (not so clever) attempt was simply combining WhereRestrictionOn and Where clause var result = session.QueryOver

Tagi: NHibernate, ORM
Dziel się z innymi:
[EN] .NET Blog: NHibernate - generating WHERE IN … OR … queries

Windows 1711 dni, 7 godzin, 18 minut temu nocturn 88 rozwiń

Today, working on a new feature for my pet project, I realized that I have to notify the view, that all properties in view model have changed. The most obvious way to achieve that would, of course be to rise PropertyChange event a bunch of times. protected virtual void OnPropertyChanged(Expression

Dziel się z innymi:
[EN] .NET Blog: INotifyPropertyChange - notifying about change of all properties at once

Windows 1720 dni, 20 godzin, 41 minut temu nocturn 170 rozwiń

Everyone who has ever tried to create multilingual application knows, that this is very tedious task. The most repetitive work is usually moving hard-coded strings to resource files. Fortunately with Resharper this is definitelly less painfull than usuall. In order to point out localizable parts of application , it is necessary to decorate classes with System.ComponentModel.LocalizableAttribute. However, usually we want to localize an entire program, so more universal solution is to set appropria...

[EN] .NET Blog: Resharper - localizable string literals

Narzędzia 1727 dni, 29 minut temu nocturn 148 rozwiń

Usually when we need to retrieve data from database server, we write code which looks like that using (var session = DataAccesLayer.Instance.OpenSession()) { using (var transaction = session.BeginTransaction()) { var projects = session.QueryOver

Tagi: C#, nHibarnate
Dziel się z innymi:
[EN] NHhibernate - multiple queries in one roundtrip to server

Windows 1828 dni, 15 godzin, 41 minut temu nocturn 118 rozwiń

Introduction I think one of the most important features of Resharper is on-the-fly code quality analysis. Basically, every time Resharper finds possible pitfall in code, it indicates this with appropriate warning. The most common warning is "Possible System.NullReferenceException". You can easily reproduce it by writing this code List

Tagi: r#, Reshar#
Dziel się z innymi:
[EN] Resharper - using annotation attributes

Windows 1891 dni, 16 godzin, 4 minuty temu nocturn 161 rozwiń

An application which I'm currently developing has quite complicated authorization system. That is why, we can not use role based authorization, and basically every developer is obliged to call appropriate security check method in every controller action he or she writes. As You probably know it is quite easy to forget about that, therefore I decided to write a test which would check whether all controller's action invokes this security critical function. After hours of searching for some anchor point, I ...

Tagi: C#, funkcje
Dziel się z innymi:
[EN] How to check if one function calls another function

Windows 1910 dni, 23 godziny, 30 minut temu nocturn 160 rozwiń

I think almost every .NET developer is familiar with INotifyPropertyChanged interface. Typical implementation of this interface looks more or less like that: public class NotifyPropertyBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged( Expression

Dziel się z innymi:
[EN] Implementing INotifyPropertyChanged without lambda expressions and "magic" strings

Windows 1932 dni, 23 godziny, 4 minuty temu nocturn 229 rozwiń

Writing mappings for models in large application is quite boring task. Fortunatelly, Fluent NHibernate provides possibility for automatic mapping creation - so called automappings.

Dziel się z innymi:
[EN] Fluent NHibernate - automappings

Narzędzia 2232 dni, 8 godzin, 1 minutę temu nocturn 165 rozwiń

Introduction In the company I'm currently working for, it is a common practice to use Devexpress XtraReports to create all kind of reports. Usually these reports are embedded into html page and used along with DevexpressReportViewer. However, lately I have been asked to open a report as a PDF file, without putting a viewer into a html page. 1. First approach After some digging, I created an action in controller which looks like this public void ExportToPdf() { using (MemorySt...

[EN]  ASP.NET MVC - Custom ActionResult

Web 2306 dni, 9 godzin, 16 minut temu nocturn 43 rozwiń

I think all Resharper users are familiar with snippets. Resharper's snippet basically generates a piece of code, which can be easily customised on the fly. All you have to do is to press TAB, and you can change names of auto-generated variables etc. Today, I decided to write my own snippet, which would make writing unit tests easier. In general, all my unit test methods looks like this [Test] public void MethodNameScenarioExpectedResult_Test() { //test logic goes in here } So let's writ...

Dziel się z innymi:
[EN] Resharper - custom snippet

Narzędzia 2306 dni, 9 godzin, 16 minut temu nocturn 38 rozwiń

1 2 3
Dodaj nowe Zobacz wszystkie

Najaktywniejsi

1

Paweł Łukasik (32 876,58)

2

macko (32 816,53)

3

pzielinski (27 178,29)

4

gordon_shumway (21 178,88)

5

paduda (20 336,33)

6

psz750 (13 018,14)

7

rroszczyk (10 434,75)

8

Damian (9 760,28)

9

danielplawgo (8 248,27)

10

arek (6 822,96)

11

burczu (6 214,22)

12

PaSkol (5 393,84)

13

lukaszgasior (4 097,38)

14

dpawlukiewicz (3 962,6)

15

jj09 (3 863,06)

16

AdrianBystrek (3 595,21)

17

spetz (3 448,35)

18

jedmac (3 318,39)

19

http://jakub-flor... (3 224,66)

20

KonradKokosa (3 105,4)