Thursday, September 21, 2017

asp.net

speichern von Infos, die über page lifetime hinausgehen:
session: wenn sie abläuft sind die daten weg
application: wenn recycled weg
viewstate: wird auf client seite gespeichert

hard links windows

https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

Windows 10 auf Hyper V installieren: Genration 2 wählen

Bei Generation 1 kommt:
"Die Microsoft-Software-Lizenzbedingungen wurden nicht gefunden. Stellen Sie sicher, dass die Installationsquellen gültig sind, und starten Sie die Installation erneut."

Bei durch VM mit Generation 2 funktioniert alles perfekt

Wednesday, September 20, 2017

make W10 Install ISO / Stick: https://www.microsoft.com/de-de/software-download/windows10

https://www.microsoft.com/de-de/software-download/windows10

sql Server Commandline Installation

Sql Express Setup from Command Prompt

only required parameters:

only sql server (db)

SETUP.EXE /QUIETSIMPLE /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT Authority\System" /SQLSYSADMINACCOUNTS="sqlpc\admin" /AGTSVCACCOUNT="NT Authority\System" /SECURITYMODE=SQL /sapwd="abc!" /IAcceptSQLServerLicenseTerms

with reporting services

SETUP.EXE /QUIETSIMPLE /ACTION=Install /FEATURES=SQL,RS /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT Authority\System" /SQLSYSADMINACCOUNTS="sqlPc\admin" /AGTSVCACCOUNT="NT Authority\System" /SECURITYMODE=SQL /sapwd="abc!" /IAcceptSQLServerLicenseTerms

with Directories specified


.\SETUP.EXE /QUIETSIMPLE /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT Authority\System" /SQLSYSADMINACCOUNTS="sqlPc\admin" /AGTSVCACCOUNT="NT Authority\System" /SECURITYMODE=SQL /sapwd="abc!" /SQLTEMPDBDIR="C:\sqlData\\" /SQLUSERDBDIR="C:\sqlData\\" /SQLUSERDBLOGDIR="C:\sqlData" /IAcceptSQLServerLicenseTerms


Monday, September 18, 2017

c# LINQ Schreibweise

//SQL Like
var ret1 = from sb in colShiftbooks select new {sb.Id};

//function
var ret2 = colShiftbooks.Select(sb => new {sb.Id});

Wednesday, September 13, 2017

c# Task Error Handling

                mail.SendAsync().ContinueWith(antecedent =>
                                              {
                                                  if (antecedent.IsFaulted)
                                                  {
                                                      _logger.Warn(antecedent.Exception, "Failed sending email");
                                                  }
                                                  else if (antecedent.IsCanceled)
                                                  {
                                                  }
                                                  else
                                                  {
                                                      _logger.Info("Succeed send email");
                                                  }
                                              });

Tuesday, September 12, 2017

EF Entity Framework Reload Entities / Refresh Cache

Reload Entities            


foreach (var entity in Context.ChangeTracker.Entries())
            {
                entity.Reload();
            }

or single entity:
Context.Entry(myEntity).Reload();

Refresh Cache

            var objectContext = ((IObjectContextAdapter)Context).ObjectContext;
            objectContext.Refresh(RefreshMode.StoreWins, Context.MyTable);