Model-View-Controller for the ASP.NET framework

learn more… | top users | synonyms

0
votes
0answers
10 views

Wrapper for jQuery Ajax to ensure redirects occur on clientside - Round 2

A while back I posted an code review on handling ajax and redirects when a server side error occurs. Wrapper for jquery ajax to ensure redirects occur on clientside Since that post I've been using ...
2
votes
1answer
45 views

Concerns about the correctness of my Repository and Controller tests

Lately I have been researching how to best unit test an EF repository and given a properly tested repository, what to test in the controller. My research did not reveal many sound examples or ...
6
votes
2answers
85 views

Concerns about my repository implementation

I have a repository called PostsRepository: ...
1
vote
1answer
48 views

Refactoring fat ASP.NET MVC Controller

I have just began porting an old project to ASP.NET MVC . In the end, I'll have a lot of controller methods like the one below, called by AJAX requests done by JQGrid objects in the pages: AJAX ...
2
votes
1answer
43 views

Client-side API design

I'm working on a client-side API for my Asp.net MVC application and I'm not quite sure I've got the code right. This API allows me to call server-side action methods via Ajax and I've designed it to ...
3
votes
1answer
34 views
2
votes
2answers
59 views
3
votes
1answer
52 views

Making Add and Edit DRY

I am coding a simple blog engine for educational purposes. In the PostsController I have two two methods that share some common code namely, ...
13
votes
1answer
125 views

How can I better name my tests?

I am relatively new to TDD and am trying to adopt better names for my tests. I wrote the following tests abruptly and have since refactored them to the best of my ability, but despite my best ...
5
votes
1answer
65 views

ListBox Update Handling

I have UserGroups for Users to be assigned to in a ListBox in HTML form. Items from listbox can be multi-selected or completely ...
3
votes
1answer
51 views

Send parameter to server and reload page

My first ASP.NET MVC 6 / jQuery web site - the site header has a "Change Language" selector (named LanguagePicker) - this is actually placed in a _Layout view, a ...
2
votes
1answer
64 views

Is my ObjectCache wrapper sound?

Wrapper: ...
7
votes
1answer
158 views

ASP.NET/MVC Features Based Authorization

Feature Based Authorization It seems to me that if you rely on roles to authorize a web application it makes it very difficult to render UI or code based on a set of features. This means that each ...
0
votes
0answers
55 views

WebApi synchronize database (EF 6) access

I'm working on an ASP.Net MVC 5 /WebApi 2 project. I'm using EF 6 code first for my database access. I've a WebApi action method in which I've to update some data in my database based on the request. ...
2
votes
1answer
76 views

Custom HtmlHelper to render a Grid

Edited: I've edited my code with the comments which are given by 'Mat's Mug'. Already a huge thanks for that. However, I've not done all the recommondations he adviced. Things which I've not done: ...
4
votes
4answers
285 views

How to write elegant conditional bits of markup in Razor views?

Suppose the following model: public class ViewBookModel { public string Title { get; set; } public string Subtitle { get; set; } } I'm currently ...
4
votes
2answers
571 views

Simple Authentication in ASP.NET MVC 5

I am building an ASP.NET MVC 5 application and, for reasons which are irrelevant at this point, I am attempting to build my own means of authenticating users. I'm still very new to programming, ...
1
vote
1answer
102 views

ASP.NET MVC Project Layering

This is how I imagine my project's layering: BLL Should be independent and contain only pure business logic and properties Sample Domain Model: ...
2
votes
1answer
59 views

View Model Filling Fields

I'm currently getting into MVC, and I'm working on a simple CRUD application but to make best use of relational database layout I need to use ViewModels so things look prettier on the UI. I have a ...
4
votes
1answer
90 views

Implementing HTTP Strict-Transport-Security via MVC action filter

HTTP Strict Transport Security (HSTS) is an opt-in security enhancement that is specified by a web application through the use of a special response header. Once a supported browser receives this ...
5
votes
2answers
196 views

Getting list of daily team goals

The old code I had before was atrociously slow but after some advice and research I was able to take a 2-5 minutes run time down to about 5-30 seconds. That is acceptable, but still looking to have ...
7
votes
2answers
2k views

Unit of Work and Repository with Entity Framework 6

Based on the reply of this question I have created the following code. I need to check whether it's good or not. Here is my entity class: ...
1
vote
2answers
322 views

Converting Anonymous To Dynamic [closed]

I have a extension method like following that takes Anonymous type objects and returns it after converting into ExpandoObject which falls under ...
7
votes
1answer
544 views

MVC 5 & EF 6 - Repository & Unit of Work Pattern

I have been looking through Code Review on the subject of Unit of Work and Repository patterns and realised that my implementation appears to provide very similar functionality but in reverse class ...
2
votes
1answer
119 views

How should I name a mapper or manager?

Recently I was reading a book called Clean Code by Robert C. Martin. There is a chapter called Meaningful Names that started me thinking if I was doing this right. I know there isn't one good way to ...
6
votes
2answers
290 views

Refactoring Methods With Conditionals

I have always suffered with too many conditionals in some of my methods. The following is a pseudocode/skeleton of one of my method like that: ...
4
votes
1answer
1k views

Concerned with Enums, JSON, and ASP.NET MVC

I am writing an application that uses ASP.NET MVC for its front end, and for the back end, it uses RavenDB to store data. This ...
4
votes
1answer
106 views

Avoiding redundant code in MVC view page

Based on the true condition, I am making some operations. But I want to simplify the below HTML code in a better way. ...
4
votes
1answer
180 views

How can I simplify these if/else clauses?

I have a few if, else-if, else clauses. The only ...
3
votes
1answer
261 views

Where to put common method used in controllers that calls service layer?

I have an ASP.NET MVC 5 web application using the repository pattern, and I have several controllers that need to call my _loggingService (queries audit logs) to ...
2
votes
2answers
83 views

How to declutter dependencies?

I'm running into a problem with my code in a ASP.NET MVC application. Maybe it's not a problem and I'm just being paranoid, but it seems like a problem to me (might be because I've just read the book ...
5
votes
1answer
1k views

Entity Framework, code-first repository pattern review. Where to validate?

I've been iterating on my repository pattern implementation over the course of the past 4-5 months. In my new projects I choose to use this pattern and I try to improve upon what I learned in previous ...
6
votes
2answers
2k views

Building a better Data Access Layer Class

Since I am new to MVC and the Entity Framework, I have been struggling to grasp the concept of creating useful Data and Service layers. I have come across a scenario where I believe my code has become ...
4
votes
1answer
96 views

How can i reduce this code?

I have a problem. This code works great, but i think it can be reduced. ...
0
votes
3answers
112 views

Task send options: Send Now, Send Later, Repeat (viewmodel)

I'm writing a code for my application: you can create a task, and you can choose the moment when you want to send this task (to some kind of user): Send now Send later Repeat You can select from ...
1
vote
2answers
1k views

Does code to save data is session or cache belong in controller?

I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods ...