コード例 #1
0
        public ActionResult <List <FeedbackOutputModel> > GetFeedbacksByPeriod(DateTimeInputModel period)
        {
            Mapper           mapper    = new Mapper();
            AuthorDataAccess feedbacks = new AuthorDataAccess();

            return(Ok(mapper.ConvertFeedbackDTOToFeedbackModelList(feedbacks.GetFeedbacksByPeriod(period.StringConverToDateTime(period.PeriodStart), period.StringConverToDateTime(period.PeriodEnd)))));
        }
コード例 #2
0
        public void DateTimeValueIsCapturedFluent()
        {
            var inputModel = new DateTimeInputModel
            {
                Id = new DateTime(2012, 5, 30)
            };

            config.ShouldMap("/api/WithDateTime/2012-05-30")
            .To <WithDateTimeController>(HttpMethod.Get, c => c.Get(inputModel));
        }
コード例 #3
0
        public MvcHtmlString DateTime <TProperty>(Expression <Func <TModel, TProperty> > expression, string placeholder = null,
                                                  string label = null)
        {
            ModelMetadata      modelMetadata      = ModelMetadata.FromLambdaExpression(expression, Helper.ViewData);
            DateTimeInputModel dateTimeInputModel = new DateTimeInputModel(Helper,
                                                                           modelMetadata,
                                                                           ExpressionHelper.GetExpressionText(expression),
                                                                           label,
                                                                           placeholder);

            return(Helper.Partial("EditorTemplates/Forms/DateTime", dateTimeInputModel));
        }