Tagged Questions
1
vote
1answer
148 views
Using AutoMapper in ASP.Net MVC
I'd like to check my understanding and usage of the AutoMapper in my ASP.Net MVC app.
I setup the maps in Application_Start:
Mapper.CreateMap<Customer, CustomerViewModel>();
...
3
votes
3answers
231 views
How to refactor this property's code?
I have a view model with properties that represent years and months:
public IEnumerable<SelectListItem> Years
{
get
{
return new SelectList(
Enumerable.Range(1900, ...
0
votes
0answers
119 views
MembershipProvider with Entity Framework and IoC in asp.net MVC3
I am using Castle Windsor as my IoC and I registered it as DependencyResolver to let MVC framework know about it.
With Entity Framework I have this DbContext:
public class MyDbContext : DbContext
{
...
3
votes
0answers
678 views
Correct usage of EF's DBContext in ASP.NET MVC application with Castle Windsor
I am trying to use Entity Framework as simple as posible. Use UnitOfWork and Repository patterns seems to be overkill because whole web application will be pretty straightforward. I came with this ...
6
votes
2answers
220 views
Is this user input field secure?
I'm pretty new to asp and c# and I have a couple of concerns with the security of the code I have written (shown below). Basically all it does is allow you to enter a quantity before you add the item ...
3
votes
3answers
106 views
What standard should I use for the naming of my MVC controller services?
I have the following:
public class ContentsController : BaseController {
private IContentService _content;
private IPageService pageService;
private IReferenceService ...
3
votes
1answer
364 views
Creating a list of pairs after splitting the string containing all of the sets
I am working on asp.net/MVC and I need to read a value from my web.config file. Splitting the list into multiple keys is not an option.
<add key="DepartAssign" value="Depart1:PersonAssignTo1; ...
3
votes
1answer
424 views
Asp.net MVC login method
I wrote this login method:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login(LoginModel logModel, string returnUrl)
{
if (!ModelState.IsValid)
{
...
5
votes
2answers
304 views
Is there a better way of writing this action method using Linq?
I have an ASP.Net MVC3 web application that displays a list of parts (A part is a simple entity with a number and a description).
I have updated the action method to support filtering and paging:
...
5
votes
2answers
922 views
ASP.NET MVC using an N-Tier Model and DDD
Any comments are welcome. However I'd like to call specific attention to my... interpretation of the N-Tier application architecture and how I'm consuming data. Note that the namespacing and inline ...
1
vote
0answers
187 views
Amazon s3 pass through controller
Some background, I am building a website that uses amazon s3 to host its image (and other) files.
I required that images displayed on the website look like they come from my site and not from amazon ...
1
vote
2answers
530 views
Many to many crud using entity framework 4.1
My view submits data to the controller using Json objects which contains child objects.It allows users to add/remove/modify the relationship with child entities(authors,categories,LIbraryBookCopy). ...
5
votes
1answer
311 views
This LINQ Model Query seems extremely inefficient
I'm new to LINQ, but I have some background in T-SQL. I know there are probably 100 different ways to design a T-SQL statement that would run this much more efficiently, but I'm not sure how I would ...
3
votes
0answers
652 views
Review of Fluent LinkedIn REST API client interface design
There is a handful of LinkedIn clients written in C# on the NuGet package library, but afaict most only do authentication via LinkedIn. I found a couple which offer a linkedin rest api interface. Of ...
1
vote
1answer
164 views
Fluent NHibernate, Getting or Creating a new `Tag`
Edit
The rest of my code utilises the Command/Query seperation pattern. I'll probably move this out into a command and a query but for now I've written this directly in my MVC controller for brevity.
...