public static Usr toUsr(this UserEntity user, Usr usr = null) { if (usr == null) { usr = new Usr(); } usr.UsrOwnId = user.Id; usr.UsrNam = user.AccountName; usr.UsrPsw = KriptoEntity.EncryptString(user.Password); usr.UsrTyp = user.UserType.ToString(); return(usr); }