asp.net-mvc

ASP.Net MVC Where do you convert from Entities to ViewModels?

放肆的年华 提交于 2021-02-07 03:37:05
问题 Title pretty much explains it all, its the last thing I'm trying to work into our project. We are structured with a Service Library which contains a function like so. /// <summary> /// Returns a single category based on the specified ID. /// </summary> public Category GetCategory(int CategoryID) { var RetVal = _session.Single<Category>(x => x.ID == CategoryID); return RetVal; } Now Category is a Entity (We are using Entity Framework) we need to convert that to a CategoryViewModel. Now, how

ASP.Net MVC Where do you convert from Entities to ViewModels?

北战南征 提交于 2021-02-07 03:34:33
问题 Title pretty much explains it all, its the last thing I'm trying to work into our project. We are structured with a Service Library which contains a function like so. /// <summary> /// Returns a single category based on the specified ID. /// </summary> public Category GetCategory(int CategoryID) { var RetVal = _session.Single<Category>(x => x.ID == CategoryID); return RetVal; } Now Category is a Entity (We are using Entity Framework) we need to convert that to a CategoryViewModel. Now, how

Rotativa / Wkhtmltopdf images not displaying

谁都会走 提交于 2021-02-07 02:33:28
问题 I am currently creating an MVC 4 web application. I have an action that has a base background image which is always the same then an arrow image which changes in degrees depending on the information that is collected within the action. I call this action using <img src="@Url.Action("trend-image", "NonReg_Reports")" alt="background" width="245" height="105" /> This works fine when it is called and is just displaying a HTML webpage. It gives me the HTML. <img src="/nonreg-report/01495344/trend

Rotativa / Wkhtmltopdf images not displaying

旧城冷巷雨未停 提交于 2021-02-07 02:33:02
问题 I am currently creating an MVC 4 web application. I have an action that has a base background image which is always the same then an arrow image which changes in degrees depending on the information that is collected within the action. I call this action using <img src="@Url.Action("trend-image", "NonReg_Reports")" alt="background" width="245" height="105" /> This works fine when it is called and is just displaying a HTML webpage. It gives me the HTML. <img src="/nonreg-report/01495344/trend

Rotativa / Wkhtmltopdf images not displaying

左心房为你撑大大i 提交于 2021-02-07 02:31:59
问题 I am currently creating an MVC 4 web application. I have an action that has a base background image which is always the same then an arrow image which changes in degrees depending on the information that is collected within the action. I call this action using <img src="@Url.Action("trend-image", "NonReg_Reports")" alt="background" width="245" height="105" /> This works fine when it is called and is just displaying a HTML webpage. It gives me the HTML. <img src="/nonreg-report/01495344/trend

Rotativa / Wkhtmltopdf images not displaying

只谈情不闲聊 提交于 2021-02-07 02:31:30
问题 I am currently creating an MVC 4 web application. I have an action that has a base background image which is always the same then an arrow image which changes in degrees depending on the information that is collected within the action. I call this action using <img src="@Url.Action("trend-image", "NonReg_Reports")" alt="background" width="245" height="105" /> This works fine when it is called and is just displaying a HTML webpage. It gives me the HTML. <img src="/nonreg-report/01495344/trend

Unrecognized configuration section

笑着哭i 提交于 2021-02-06 20:44:11
问题 I have created a custom configuration section like below <configSections> </configSections> <Tabs> <Tab name="Dashboard" visibility="true" /> <Tab name="VirtualMachineRequest" visibility="true" /> <Tab name="SoftwareRequest" visibility="true" /> </Tabs> Custom Configuration Section Handler namespace EDaaS.Web.Helper { public class CustomConfigurationHandler : ConfigurationSection { [ConfigurationProperty("visibility", DefaultValue = "true", IsRequired = false)] public Boolean Visibility { get

Unrecognized configuration section

若如初见. 提交于 2021-02-06 20:44:05
问题 I have created a custom configuration section like below <configSections> </configSections> <Tabs> <Tab name="Dashboard" visibility="true" /> <Tab name="VirtualMachineRequest" visibility="true" /> <Tab name="SoftwareRequest" visibility="true" /> </Tabs> Custom Configuration Section Handler namespace EDaaS.Web.Helper { public class CustomConfigurationHandler : ConfigurationSection { [ConfigurationProperty("visibility", DefaultValue = "true", IsRequired = false)] public Boolean Visibility { get

MVC ASP.NET is using a lot of memory

喜你入骨 提交于 2021-02-06 19:55:45
问题 If I just browse some pages on the app, it sits at around 500MB. Many of these pages access the database but at this point in time, I only have roughly a couple of rows each for 10 tables, mostly storing strings and some small icons that are less than 50KB. The real problem occurs when when I download a file. The file is roughly 140MB and is stored as a varbinary(MAX) in the database. The memory usage suddenly rises to 1.3GB for a split second and then falls back to 1GB. The code for that

How to change site language using Resources and CultureInfo in ASP .NET MVC?

偶尔善良 提交于 2021-02-06 13:53:18
问题 I have several resource files for each language I want to support, named like below: NavigationMenu.en-US.resx NavigationMenu.ru-RU.resx NavigationMenu.uk-UA.resx Files are located in MySolution/Resources/NavigationMenu folder. I have action which sets CurrentCulture and CurrentUICulture like below public ActionResult SetLanguage(string lang) { try { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang); Thread.CurrentThread.CurrentUICulture = CultureInfo