For developing SOAP / WCF services use:
System.ServiceModel.Http NUPackage
Use SVCUTIL to generate proxy from WSDL file or url.
If you get error :
PlatformNotSupportedException: Compiling JScript/CSharp scripts is not supported
read this:
https://github.com/dotnet/wcf/issues/2219
Put this before Client method call:
MethodInfo method = typeof(XmlSerializer).GetMethod("set_Mode", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
method.Invoke(null, new object[] { 1 });
Feb 28, 2018
Feb 15, 2018
Bootstrap Custom Controls
Feb. 2018
Bootstrap Date picker with localization
Only one package required for example Bower or npm:
bootstrap-datepicker
Reference package and css with appropriate Locale file. Dist folder is here only due to Bower :
<link rel="stylesheet" href="~/lib/bootstrap-datepicker/dist/css/bootstrap-datepicker.standalone.min.css" />
<script src="~/lib/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script src="~/lib/bootstrap-datepicker/dist/locales/bootstrap-datepicker.hr.min.js"></script>
Set language param during init and it should work:
$('input[name="Birthday2"]').datepicker({
isRTL: false,
format: 'dd.mm.yyyy',
autoclose: true,
language: 'hr'
});
Bootstrap Multiselect Checkpoint
https://github.com/davidstutz/bootstrap-multiselect.git
http://davidstutz.de/bootstrap-multiselect/
Apply on existing <select> DOM element.
<script src="~/lib/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
Bootstrap Date picker with localization
Only one package required for example Bower or npm:
bootstrap-datepicker
Reference package and css with appropriate Locale file. Dist folder is here only due to Bower :
<link rel="stylesheet" href="~/lib/bootstrap-datepicker/dist/css/bootstrap-datepicker.standalone.min.css" />
...
<script src="~/lib/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script src="~/lib/bootstrap-datepicker/dist/locales/bootstrap-datepicker.hr.min.js"></script>
Set language param during init and it should work:
$('input[name="Birthday2"]').datepicker({
isRTL: false,
format: 'dd.mm.yyyy',
autoclose: true,
language: 'hr'
});
Bootstrap Multiselect Checkpoint
https://github.com/davidstutz/bootstrap-multiselect.git
http://davidstutz.de/bootstrap-multiselect/
Apply on existing <select> DOM element.
<script src="~/lib/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="~/lib/bootstrap-multiselect/dist/css/bootstrap-multiselect.css"/>
$(dom.multiselectCss).multiselect();
Feb 6, 2018
ASP.NET MVC - Injecting C# data into Java script
Inside Razor view use Newtonsoft JSON serialization from C# to JSON:
@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.CityList, Newtonsoft.Json.Formatting.None));
@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.CityList, Newtonsoft.Json.Formatting.None));
Feb 2, 2018
Dependency injection and IoC generally and in .NET core
https://msdn.microsoft.com/en-us/magazine/mt707534.aspx
https://www.devtrends.co.uk/blog/how-not-to-do-dependency-injection-the-static-or-singleton-container
http://codebetter.com/jeremymiller/2005/09/20/what%E2%80%99s-so-great-about-inversion-of-control/
http://codebetter.com/jeremymiller/2005/10/06/the-dependency-injection-pattern-%E2%80%93-what-is-it-and-why-do-i-care/
ASP.NET Core 2.0
How to resolve service instances inside ConfigureServices in Startup.cs
https://andrewlock.net/accessing-services-when-configuring-mvcoptions-in-asp-net-core/
There is :
IConfigureOptions
; so you can write this:
services.AddSingleton<IConfigureOptions<MvcOptions>, ConfigureMvcOptions>();
https://www.devtrends.co.uk/blog/how-not-to-do-dependency-injection-the-static-or-singleton-container
http://codebetter.com/jeremymiller/2005/09/20/what%E2%80%99s-so-great-about-inversion-of-control/
http://codebetter.com/jeremymiller/2005/10/06/the-dependency-injection-pattern-%E2%80%93-what-is-it-and-why-do-i-care/
ASP.NET Core 2.0
How to resolve service instances inside ConfigureServices in Startup.cs
https://andrewlock.net/accessing-services-when-configuring-mvcoptions-in-asp-net-core/
services.AddTransient<IMyService,MyService>();
services.AddMvc(options => {
// Need instance of MyService here ?
}
There is :
IConfigureOptions
; so you can write this:
services.AddSingleton<IConfigureOptions<MvcOptions>, ConfigureMvcOptions>();
Subscribe to:
Posts (Atom)