Exemple #1
0
        internal void EnableProjectFeature(IncomignFeatureRequest request)
        {
            var project = Context.Projects.FirstOrDefault(x => x.Id == request.ProjectId);

            switch (request.RuleName)
            {
            case "BugReport":
                project.AllowPublicBugs = request.Value;
                break;

            case "FeatureRequest":
                project.AllowPublicFeatures = request.Value;
                break;

            case "PublicMessage":
                project.AllowPublicMessages = request.Value;
                break;

            case "FeedbackPage":
                project.AllowPublicFeedback = request.Value;
                break;
            }
            Context.Attach(project);
            Context.Update(project);
            Context.SaveChanges();
        }
        public OutgoingJsonData EnableProjectFeature([FromBody] IncomignFeatureRequest request)
        {
            using (var context = new ApiKeysContext(Context, Configuration))
            {
                // if()
                //TODO Implement user right check

                context.EnableProjectFeature(request);
            }
            return(new OutgoingJsonData {
            });
        }