c# Programming Glossary: models
Getting ServiceStack to retain type information http://stackoverflow.com/questions/10750571/getting-servicestack-to-retain-type-information in DTO's and very few reasons to have them on POCO models it's a cargo cult habit of using interfaces to reduce coupling..
Entity Framework initialization is SLOW — what can I do to bootstrap it faster? http://stackoverflow.com/questions/10757019/entity-framework-initialization-is-slow-what-can-i-do-to-bootstrap-it-faster question View generation is known to be slow for bigger models. For now the solution is to use pregenerated views. This way..
Recommended ServiceStack API Structure http://stackoverflow.com/questions/15231537/recommended-servicestack-api-structure Request DTO names myself to avoid clashing with data models of the same name. Although I've separated UpdateEvent and CreateEvent.. EventMan.Logic For larger projs pure C# logic data models etc IGoogleCalendarGateway E.g of a external dependency this..
How to do a Bulk Insert — Linq to Entities http://stackoverflow.com/questions/1609153/how-to-do-a-bulk-insert-linq-to-entities improve this question Sometimes you simply have to mix models. Perhaps use SqlBulkCopy for this part of your repository since..
The need for volatile modifier in double checked locking in .NET http://stackoverflow.com/questions/1964731/the-need-for-volatile-modifier-in-double-checked-locking-in-net x86 and x64 processors. It might be true in other memory models like on Mono and other implementations Itanium64 and future..
Transactions in .net http://stackoverflow.com/questions/224689/transactions-in-net Or there are even some TransactionScope compatible object models around i.e. .NET classes with rollback capability perhaps easier..
In what areas might the use of F# be more appropriate than C#? [closed] http://stackoverflow.com/questions/2785029/in-what-areas-might-the-use-of-f-be-more-appropriate-than-c primary emphasis. I'm interested in any successful models employing these two languages in your production polyglot programs..
Converting RGB to HSB Colors http://stackoverflow.com/questions/4106363/converting-rgb-to-hsb-colors modes this makes absolutely sense The HSL cylinder In both models the hue acts as the same by using color Red as start and end.. which result in a white color. The HSB cylinder In both models the hue acts as the same by using color Red as start and end.. my extension function are using different coloring models. So you should check if you find somewhere an implementation..
Changing the View for a ViewModel http://stackoverflow.com/questions/5309099/changing-the-view-for-a-viewmodel WPF application. In order to connect the view to the viewmodels I use a ResourceDictionary used in Application.Resources that.. SampleViewModel view SampleView1 DataTemplate The view models are then simply put into content presenters to display them...
Disable Required validation attribute under certain circumstances http://stackoverflow.com/questions/5367287/disable-required-validation-attribute-under-certain-circumstances question This problem can be easily solved by using view models. View models are classes that are specifically tailored to the.. problem can be easily solved by using view models. View models are classes that are specifically tailored to the needs of a.. for example in your case you could have the following view models public UpdateViewView Required public string Id get set .....
Binding WPF ComboBox to a Custom List http://stackoverflow.com/questions/561166/binding-wpf-combobox-to-a-custom-list modifications and it seems to work fine. I can set the viewmodels PhoneBookEnty property and the selected item in the combobox.. can change the selected item in the combobox and the view models PhoneBookEntry property is set correctly. Here is my xaml Window..
Read MS Exchange email in C# http://stackoverflow.com/questions/652549/read-ms-exchange-email-in-c-sharp problems with memory leaks due to their differing memory models. You could use CDOEX but that only works on the Exchange server..
Is it possible to bind a Canvas's Children property in XAML? http://stackoverflow.com/questions/889825/is-it-possible-to-bind-a-canvass-children-property-in-xaml You can bind your ViewModel's ObservableCollection of data models to their ItemsSource property and use DataTemplates to handle..
ServiceStack.Net Redis: Storing Related Objects vs. Related Object Ids http://stackoverflow.com/questions/8914349/servicestack-net-redis-storing-related-objects-vs-related-object-ids be able to make better decisions about how to design your models once you can see how they're stored. How POCO Entities are stored..
What's the difference between SortedList and SortedDictionary? http://stackoverflow.com/questions/935621/whats-the-difference-between-sortedlist-and-sorteddictionary TValue generic class. The two classes have similar object models and both have O log n retrieval. Where the two classes differ..
MVVM: Binding to Model while keeping Model in sync with a server version http://stackoverflow.com/questions/10437241/mvvm-binding-to-model-while-keeping-model-in-sync-with-a-server-version of how it was designed. Setup Views always bind to ViewModels. I know it's a lot of boilerplate but binding directly to Models.. I know it's a lot of boilerplate but binding directly to Models is not acceptable in any but the simplest scenarios it's also.. scenarios it's also not in the spirit of MVVM. ViewModels have sole responsibility for pushing changes. This obviously..
Should I stop fighting Visual Studio's default namespace naming convention? http://stackoverflow.com/questions/1289425/should-i-stop-fighting-visual-studios-default-namespace-naming-convention on an MVVM project so I have folders in my project like Models ViewModels Windows etc. Whenever I create a new class Visual.. project so I have folders in my project like Models ViewModels Windows etc. Whenever I create a new class Visual Studio automatically.. project level namespace. So adding a new class to the ViewModels folder would result in the namespace MyProject.ViewModels instead..
View Models and dependency injection http://stackoverflow.com/questions/14131804/view-models-and-dependency-injection Models and dependency injection While working on a LOB desktop application..
Transitioning from Windows Forms to WPF http://stackoverflow.com/questions/15681352/transitioning-from-windows-forms-to-wpf interface that reflects your data classes typically Models and ViewModels And personally I prefer to type all my XAML out.. that reflects your data classes typically Models and ViewModels And personally I prefer to type all my XAML out by hand since..
SqlException from Entity Framework - New transaction is not allowed because there are other threads running in the session http://stackoverflow.com/questions/2113498/sqlexception-from-entity-framework-new-transaction-is-not-allowed-because-ther class ProductManager IProductManager #region Declare Models private RivWorks.Model.Negotiation.RIV_Entities _dbRiv RivWorks.Model.Stores.RivEntities..
Populating Dropdownlist Using MVC2 Based On Another Dropdownlist (Cascading DropDownList) http://stackoverflow.com/questions/3743803/populating-dropdownlist-using-mvc2-based-on-another-dropdownlist-cascading-drop vehicles. I need two DropDownLists Makes All Vehicle Makes Models Models that belong to the selected value of the Make DropDownList.. I need two DropDownLists Makes All Vehicle Makes Models Models that belong to the selected value of the Make DropDownList How.. call when my first list is selected and then pull back the Models to bind to the Model DDL How would model binding come into play..
Using the Razor view engine in a different way http://stackoverflow.com/questions/3808076/using-the-razor-view-engine-in-a-different-way Calling the code string Template Hello @Model.Name Models.User user new Models.User Name Billy Boy RazorViewEngineRender.. string Template Hello @Model.Name Models.User user new Models.User Name Billy Boy RazorViewEngineRender view new RazorViewEngineRender.. user pass in your model Notes This only works with typed Models. I attempted to pass in a new Name Billy Boy and it's throwing..
Multiple Model in a Single View (# MVC3) http://stackoverflow.com/questions/5763631/multiple-model-in-a-single-view-mvc3 this question You should always create separate ViewModels for your views. There should be an abstraction from your Views.. should be an abstraction from your Views to your Domain Models. In the demos tutorials they show it all pretty and easy by.. and easy by simply strongly typing the Views to Domain Models but that's not a good strategy. The views should not be dependent..
Multithreading reference? http://stackoverflow.com/questions/601558/multithreading-reference Code INFO Descriptions and Workings of OLE Threading Models COM STA MTA C# Threading Thread Synchronization C# Programming..
Downcasting with Entity Framework http://stackoverflow.com/questions/7266848/downcasting-with-entity-framework Users .. Documents Visual Studio 2010 Projects .. Website Models EF.Custom.cs fine. I then overloaded the constructor for Employer..
Serializable classes and dynamic proxies in EF - how? http://stackoverflow.com/questions/7276507/serializable-classes-and-dynamic-proxies-in-ef-how Projects . Website Extensions.Object.cs line 49 at .Web.Models.Employer..ctor User u in C Users . Documents Visual Studio 2010.. C Users . Documents Visual Studio 2010 Projects . Website Models EF.Custom.cs line 121 at .Web.Controllers.AuthController.Register.. C Users . Documents Visual Studio 2010 Projects . Website Models EF.Custom.cs 128 10 Website Update II the point of the exercise..
What's the best way to call a modal dialog in ASP.NET MVC using Twitter Bootstrap? http://stackoverflow.com/questions/8093633/whats-the-best-way-to-call-a-modal-dialog-in-asp-net-mvc-using-twitter-bootstra 4 so let's add a simple model class MyViewModel.cs to the Models folder using System.ComponentModel.DataAnnotations namespace.. namespace MvcApplication1.Models public class MyViewModel public string Foo get set Required.. Add the following lines using MvcApplication1.Models ... public ActionResult Create return PartialView _Create ..
Big smart ViewModels, dumb Views, and any model, the best MVVM approach? http://stackoverflow.com/questions/857820/big-smart-viewmodels-dumb-views-and-any-model-the-best-mvvm-approach smart ViewModels dumb Views and any model the best MVVM approach The following.. code is a refactoring of my previous MVVM approach Fat Models skinny ViewModels and dumb Views the best MVVM approach in which.. of my previous MVVM approach Fat Models skinny ViewModels and dumb Views the best MVVM approach in which I moved the logic..
|