| | | 1 | | using System; |
| | | 2 | | using Microsoft.Xrm.Sdk; |
| | | 3 | | using Microsoft.Crm.Sdk.Messages; |
| | | 4 | | using System.Reflection; |
| | | 5 | | using System.Diagnostics; |
| | | 6 | | |
| | | 7 | | namespace FakeXrmEasy.FakeMessageExecutors |
| | | 8 | | { |
| | | 9 | | public class RetrieveVersionRequestExecutor : IFakeMessageExecutor |
| | | 10 | | { |
| | | 11 | | public bool CanExecute(OrganizationRequest request) |
| | 6 | 12 | | { |
| | 6 | 13 | | return request is RetrieveVersionRequest; |
| | 6 | 14 | | } |
| | | 15 | | |
| | | 16 | | public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx) |
| | 6 | 17 | | { |
| | 6 | 18 | | var assemblyPath = Assembly.GetAssembly(typeof(RetrieveVersionRequest)).Location; |
| | 6 | 19 | | var versionInfo = FileVersionInfo.GetVersionInfo(assemblyPath); |
| | 6 | 20 | | var version = versionInfo.FileVersion; |
| | | 21 | | |
| | 6 | 22 | | return new RetrieveVersionResponse |
| | 6 | 23 | | { |
| | 6 | 24 | | Results = new ParameterCollection |
| | 6 | 25 | | { |
| | 6 | 26 | | { "Version", version } |
| | 6 | 27 | | } |
| | 6 | 28 | | }; |
| | 6 | 29 | | } |
| | | 30 | | |
| | | 31 | | public Type GetResponsibleRequestType() |
| | 4270 | 32 | | { |
| | 4270 | 33 | | return typeof(RetrieveVersionRequest); |
| | 4270 | 34 | | } |
| | | 35 | | } |
| | | 36 | | } |