2
votes
2answers
89 views

User Login Logic

I want to see if this is as streamlined as possible. Most of the logic is accomplished through methods in the model. The controller does one of four things: redirects new users to registration ...
2
votes
2answers
54 views

Return custom assembly attribute variables

I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. ...
4
votes
1answer
122 views

Using static management class to control db transactions through an EF6

I have the class below to manage my specific implementation of a membership system using entity framework 6.1 Is the use of static access correct in this case? as far as I understood that EF context ...
2
votes
1answer
2k views

When to use separate DBContext classes?

I know that the DBContext represents a session (Unit-Of-Work and Repository) with the database, however I an unsure as to when I should have a different DBContext. Currently, I have a separate ...
1
vote
1answer
3k 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: ...
3
votes
3answers
323 views

How to refactor this property's code?

I have a view model with properties that represent years and months: ...
1
vote
0answers
264 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: ...
8
votes
1answer
5k 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
308 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
123 views

What standard should I use for the naming of my MVC controller services?

I have the following: ...
3
votes
1answer
2k 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. ...
3
votes
1answer
1k views

Asp.net MVC login method

I wrote this login method: ...
3
votes
3answers
808 views

Self populating view models

So I have a view model (asp.net mcv 3 app) that when instantiated with a particular parameter, populates it's properties via a couple of calls to a web service in it's constructor. ...
5
votes
2answers
490 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
1k 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
303 views

Amazon s3 pass through controller [closed]

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
741 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
488 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 ...
12
votes
1answer
2k views

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
283 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. ...
36
votes
4answers
29k views

EF Code First with Repository, UnitOfWork and DbContextFactory

I am about to >explode< :) due to amount of reading on this subject... My head hurts, and I need some honest opinions... There is a similar question/review that I noticed, but I believe my approach ...
4
votes
1answer
324 views

my code is ugly

I have a method which load data from a remote app(send tcp request and parse response). Now, I have simple class for send tcp request: ...
2
votes
2answers
348 views

How can I avoid all this code duplication?

As you can see I have to populate the ViewModel with the List of Tags so that the dropdown can have all the options for the user to select. And I have to do this 2 times for the Create Action and 2 ...
3
votes
1answer
2k views

Is this a workable UnitOfWork with Repository pattern Design

I am building a web app with using UOW and Repository pattern. I have seen many different samples and found each one to be different, so not sure which is the correct way to go. I have a basic ...
3
votes
0answers
722 views

ASP.NET MVC 3 ModelBinder with string sanitizing

I need to allow incoming HTML in string parameters in my projects action methods, so we have disabled Input Validation. I have a good HTML sanitizer; the review I am interested in is the way I bound ...
1
vote
3answers
94 views

Improving readability and logic on “re-indexing” method

This is a method which takes an input of a "page" object, which includes SortOrder. It then fetches the existing page items from a database and attempts to re-index. I don't think this is at all ...
2
votes
0answers
504 views

MVC Async Action Invoking Workflow

I've just started working with Workflow (WF4) and have been playing with an idea of using it in MVC3.0 controller actions to see if it improves the maintainability of complex actions; also potentially ...
4
votes
1answer
3k views

ASP.NET MVC models that can be validated without using attributes

The model looks like this, with no attributes: ...
4
votes
1answer
497 views

LINQ generating chart

I'm generating a table to use on jQuery visualize plugin and generate a chart. The code is pretty good, but maybe there is a way to improve it. Maybe do more work on the LINQ query and less stuff on ...
2
votes
3answers
216 views

ASP.NET MVC Html.XXFor OK to discard lambda argument and just use Model directly?

I find it a bit odd in ASP.NET MVC that the Html helper extensions, like Html.EditorFor, take a ...
3
votes
1answer
4k views

nTier architecture for an MVC application

I am endeavoring to build my first non-trivial web application and so I'd like to confirm a couple of design decisions. I have three tiers as follows: UI (my MVC project) Business Logic (separate ...
2
votes
0answers
961 views

Using WIF with ASP MVC 3 for authorization [closed]

What can be the best way to implement custom authorization attribute in MVC 3 using claims? For example we have claims: ...
3
votes
2answers
2k views

Old-way of asynchronous programming in ASP.NET MVC 3

On ASP.NET MVC, I try to write an async Controller action with the old asynchronous programming model (actually, it is the current one, new one is still a CTP). Here, I am trying to run 4 operations ...
7
votes
1answer
17k views

MVC Custom Authentication, Authorization, and Roles Implementation

Bear with me as I provide details for the issue... I've got an MVC site, using FormsAuthentication and custom service classes for Authentication, Authorization, ...
7
votes
1answer
9k views

Custom route for writing friendly URLs in ASP.NET MVC 3

I'm trying to build friendly URLs like this /post/1/my-first-post. I started out with building my links like this: ...
1
vote
2answers
5k views

Renaming file in C# on Server

I am using the following code to rename the uploaded files for any future name clashes. Please tell if my approach is right or I should follow some other approach or approach which is better. ...
3
votes
2answers
1k views

ASP.NET MVC using Repository pattern - code review

I am just trying to use ASP.NET MVC using repository pattern. Could somebody see If I am doing something wrong here. Model - Contains the model ...
3
votes
1answer
301 views

Need help with cleaning up this Controller

I've written the following controller and i was looking for some input/advice on how i could go about cleaning this up or rewriting it. I feel like i'm repeating myself a lot or that there might be a ...
8
votes
1answer
2k views

ASP.NET MVC: Please review my implementation of a generic DropDownList attribute and templating solution

My goal was to be able to render my view models using a standard Object.cshtml editor and display template. In order to do so I needed to be able to always call ...
5
votes
2answers
1k views

trying to optimize conditional string building

Essentially I'm taking a number of checkboxes off of my view, adding them to a Dictionary<string, bool>, and writing out the ...
1
vote
1answer
697 views

Use of Ninject and an injectable DataLayer in MVC3

I'm trying to make an MVC3 application with an exchangeable data layer and below is the code I have currently. In a single file (Global.asax.cs) for brievity. It seems to be working as I want but as ...
13
votes
6answers
20k views

Is there a better way to do dynamic filtering and sorting with Entity Framework than this?

I'm developing an application using ASP.NET MVC 3 and Entity Framework 4.1. In that application I have a lot of paged lists. Users can filter and sort these lists. This results in code like the one ...
4
votes
3answers
554 views

Not feeling 100% about my Controller design.

Basically, I'm uploading an excel file and parsing the information then displaying what was parsed in a view. ...