我最近在一个文档上编写了这个代码库,我请求帮助以查看我编写的代码是否适用于文档。 [英] I recently wrote this code base on a document, I asking for help to see if the code I have written works for the documents.

查看:80
本文介绍了我最近在一个文档上编写了这个代码库,我请求帮助以查看我编写的代码是否适用于文档。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Method Name NewItem
Description  Generate a Initialized object
Direction Parameter: Input None, Output Object

Method Name Get
Description Retrieve a constructed object meeting the input specified
Direction Parameter: Input Id (string), Output Object

Method Name Save
Description  Create new object or update existing object returning the results that were saved
Direction Parameter: Input Object, Output Object

Method Name Delete
Description Remove object from use
Direction Parameter: Input Id (string), Output None

Method Name GetHistory

Description Retrieve a constructed collection of object meeting the input specified
Direction Parameter: Input Id (string), Output object (Array)





我的代码是这个。





My code is this.

using System.Collections.Generic;
using System.ServiceModel;

namespace 
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "Object" in both code and config file together.
    [ServiceContract]
    public interface IObject
    {
        [OperationContract]
        void NewItem();

        [OperationContract]
        string Get(string Id);

        [OperationContract]
        Object Save(object Id, object saved );

        [OperationContract]
        void Delete(string Id);

        [OperationContract]
        List<Object> History(string Id, List<object> meeting);

    }
}







using System;
using System.Collections.Generic;
using System.Linq;


namespace 
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "object" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select object.svc or object.svc.cs at the Solution Explorer and start debugging.
    public class Object : IObject
    {
        public void NewItem()
        {
            throw new NotImplementedException();
        }

        public string Get(string trailerId)
        {
            return Id;
        }

        public object Save(Id, trailer)
        {
            return trailer;
        }
      
      
        public void Delete(string Id)
        {
            throw new NotImplementedException();
        }

        public List<object>; GetHistory(string trailerId, List<object> meeting)
        {
            return meeting.Select(history => history).ToList();
        }
    }
}





这是模板布局如果不正确我需要什么改变。谢谢。



This is a template layout If not correct what do I need to change. Thanks.

推荐答案

作为一个模板,它是好的,但没有填写任何细节,我们无法真正告诉。



但是,你选择的名字很差:已经有一个对象类 [ ^ ]在.NET中



试一试:如果你错了,那你就不行了不花任何时间来实现它,如果不能解决它就不会浪费很多......
As a template, it's sort-of-OK, but without any details filled in we can't really tell.

However, your choice of names is very poor: there is already an Object class[^] in .NET

Give it a try: if you are wrong, then since you didn't spend any real time coming up with that, it's not a lot to waste if it doesn't work out...


这篇关于我最近在一个文档上编写了这个代码库,我请求帮助以查看我编写的代码是否适用于文档。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆